File tree 2 files changed +18
-1
lines changed 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,12 @@ async function run () {
29
29
30
30
process . env . NODE_V8_COVERAGE = argv . tempDirectory
31
31
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
+ }
33
38
done ( )
34
39
} )
35
40
}
Original file line number Diff line number Diff line change @@ -53,6 +53,18 @@ describe('c8', () => {
53
53
)
54
54
} )
55
55
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
+
56
68
describe ( 'check-coverage' , ( ) => {
57
69
before ( ( ) => {
58
70
spawnSync ( nodePath , [
You can’t perform that action at this time.
0 commit comments