gotwarlost / istanbul

Yet another JS code coverage tool that computes statement, line, function and branch coverage with module loader hooks to transparently add coverage when running tests. Supports all JS coverage use cases including unit tests, server side functional tests and browser tests. Built for scale.
Other
8.7k stars 785 forks source link

'Unexpected token ...' cause 'exit without writing coverage information' #880

Closed pokkke closed 5 years ago

pokkke commented 6 years ago

This code section

return {
    message: this.message,
    ...(process.env.NODE_ENV !== 'production') && { stack: this.stack },
};

equivalent to this code

const simpleError = {
    message: this.message,
};
if (process.env.NODE_ENV !== 'production') {
    simpleError.stack = this.stack;
}
return simpleError;

Cause coverage compilation failure

bsyk commented 6 years ago

You probably want to check out nyc the 'new' version of istanbul. This repo is deprecated as mentioned in the readme.