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

Pass environment variables to child process #897

Closed fabiosantoscode closed 5 years ago

fabiosantoscode commented 5 years ago

Currently when you pass an environment variable to istanbul cover, it doesn't get to the covered file.

fabiosantoscode commented 5 years ago
$ cat test.js
console.log(process.env.FOO)
$ FOO=1 istanbul cover test.js
undefined
[...]
fabiosantoscode commented 5 years ago

False positive. I forgot to pass the variable..