File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,12 @@ async function run () {
2929
3030 process . env . NODE_V8_COVERAGE = argv . tempDirectory
3131 foreground ( hideInstrumenterArgs ( argv ) , async ( done ) => {
32- await outputReport ( argv )
32+ try {
33+ await outputReport ( argv )
34+ } catch ( err ) {
35+ console . error ( err . stack )
36+ process . exitCode = 1
37+ }
3338 done ( )
3439 } )
3540 }
Original file line number Diff line number Diff line change @@ -53,6 +53,18 @@ describe('c8', () => {
5353 )
5454 } )
5555
56+ it ( 'exits with 1 when report output fails' , ( ) => {
57+ const { status, stderr } = spawnSync ( nodePath , [
58+ c8Path ,
59+ '--clean=false' ,
60+ '--reporter=unknown' ,
61+ nodePath ,
62+ '--version'
63+ ] )
64+ status . should . equal ( 1 )
65+ stderr . toString ( ) . should . match ( / C a n n o t f i n d m o d u l e ' u n k n o w n ' / u)
66+ } )
67+
5668 describe ( 'check-coverage' , ( ) => {
5769 before ( ( ) => {
5870 spawnSync ( nodePath , [
You can’t perform that action at this time.
0 commit comments