@@ -225,7 +225,7 @@ test('overridden exclude should still apply defaults', async () => {
225225 expect ( coverageMap . files ( ) ) . toMatchInlineSnapshot ( `{}` )
226226} )
227227
228- test ( 'uncovered files are transformed correctly' , async ( ) => {
228+ test ( 'uncovered files are transformed correctly (node and browser) ' , async ( ) => {
229229 await runVitest ( {
230230 config : 'fixtures/configs/vitest.config.conditional.ts' ,
231231 include : [ 'fixtures/test/math.test.ts' ] ,
@@ -242,20 +242,44 @@ test('uncovered files are transformed correctly', async () => {
242242 expect ( files ) . toMatchInlineSnapshot ( `
243243 [
244244 "<process-cwd>/fixtures/src/math.ts",
245- "<process-cwd>/fixtures/src/conditional/browser .ts",
245+ "<process-cwd>/fixtures/src/conditional/web .ts",
246246 ]
247247 ` )
248248 }
249249 else {
250250 expect ( files ) . toMatchInlineSnapshot ( `
251251 [
252252 "<process-cwd>/fixtures/src/math.ts",
253- "<process-cwd>/fixtures/src/conditional/node .ts",
253+ "<process-cwd>/fixtures/src/conditional/ssr .ts",
254254 ]
255255 ` )
256256 }
257257} )
258258
259+ test ( 'uncovered files are transformed correctly (jsdom)' , async ( { skip } ) => {
260+ skip ( isBrowser ( ) , 'node relevant test' )
261+
262+ await runVitest ( {
263+ config : 'fixtures/configs/vitest.config.conditional.ts' ,
264+ include : [ 'fixtures/test/math.test.ts' ] ,
265+ environment : 'jsdom' ,
266+ coverage : {
267+ include : [ 'fixtures/src/math.ts' , 'fixtures/src/conditional/*' ] ,
268+ reporter : 'json' ,
269+ } ,
270+ } )
271+
272+ const coverageMap = await readCoverageMap ( )
273+ const files = coverageMap . files ( )
274+
275+ expect ( files ) . toMatchInlineSnapshot ( `
276+ [
277+ "<process-cwd>/fixtures/src/math.ts",
278+ "<process-cwd>/fixtures/src/conditional/web.ts",
279+ ]
280+ ` )
281+ } )
282+
259283test ( 'files included and excluded in plugin\'s configureVitest are excluded' , async ( ) => {
260284 await runVitest ( {
261285 config : 'fixtures/configs/vitest.config.configure-vitest-hook.ts' ,
0 commit comments