@@ -235,7 +235,6 @@ t.test('run an html report', async t => {
235
235
const comments = t . capture ( mockTap , 'comment' )
236
236
let openerRan = false
237
237
const htmlReport = resolve ( globCwd , '.tap/report' , file )
238
- const exitCode = t . intercept ( process , 'exitCode' )
239
238
const { report } = ( await t . mockImport ( '../dist/report.js' , {
240
239
c8 : { Report : MockReport } ,
241
240
'@tapjs/core' : mockCore ,
@@ -259,7 +258,6 @@ t.test('run an html report', async t => {
259
258
t . strictSame ( comments . args ( ) , [ ] )
260
259
t . equal ( openerRan , true )
261
260
t . equal ( readFileSync ( htmlReport , 'utf8' ) , 'report' )
262
- t . strictSame ( exitCode ( ) , [ ] )
263
261
} )
264
262
}
265
263
} )
@@ -278,11 +276,11 @@ t.test('no coverage files generated', async t => {
278
276
} ) ) as typeof import ( '../dist/report.js' )
279
277
const config = new MockConfig ( [ ] )
280
278
const logs = t . capture ( console , 'log' )
281
- const exitCode = t . intercept ( process , 'exitCode' )
282
279
await report ( [ ] , config as unknown as LoadedConfig )
283
280
t . strictSame ( logs . args ( ) , [ ] )
284
281
t . strictSame ( comments . args ( ) , [ [ 'No coverage generated' ] ] )
285
- t . match ( exitCode ( ) , [ { type : 'set' , value : 1 , success : true } ] )
282
+ t . equal ( process . exitCode , 1 )
283
+ process . exitCode = 0
286
284
} )
287
285
288
286
t . test ( 'no coverage summary generated' , async t => {
@@ -299,11 +297,11 @@ t.test('no coverage summary generated', async t => {
299
297
} ) ) as typeof import ( '../dist/report.js' )
300
298
const config = new MockConfig ( [ ] )
301
299
const logs = t . capture ( console , 'log' )
302
- const exitCode = t . intercept ( process , 'exitCode' )
303
300
await report ( [ ] , config as unknown as LoadedConfig )
304
301
t . strictSame ( logs . args ( ) , [ ] )
305
302
t . strictSame ( comments . args ( ) , [ [ 'No coverage generated' ] ] )
306
- t . match ( exitCode ( ) , [ { type : 'set' , value : 1 , success : true } ] )
303
+ t . equal ( process . exitCode , 1 )
304
+ process . exitCode = 0
307
305
} )
308
306
309
307
t . test ( 'not full coverage' , async t => {
@@ -326,7 +324,6 @@ t.test('not full coverage', async t => {
326
324
} ) ) as typeof import ( '../dist/report.js' )
327
325
const config = new MockConfig ( [ ] )
328
326
const logs = t . capture ( console , 'log' )
329
- const exitCode = t . intercept ( process , 'exitCode' )
330
327
await report ( [ 'html' ] , config as unknown as LoadedConfig )
331
328
t . strictSame ( logs . args ( ) , [ ] )
332
329
t . strictSame ( comments . args ( ) , [
@@ -337,5 +334,6 @@ t.test('not full coverage', async t => {
337
334
] )
338
335
t . equal ( openerRan , true )
339
336
t . equal ( readFileSync ( htmlReport , 'utf8' ) , 'report' )
340
- t . match ( exitCode ( ) , [ { type : 'set' , value : 1 , success : true } ] )
337
+ t . equal ( process . exitCode , 1 )
338
+ process . exitCode = 0
341
339
} )
0 commit comments