path inconsistency running tests in coverage mode
Expected behavior: That tests run consistently whether in coverage mode or not. Specifically that stack traces would contain the same paths. These paths are used by testing tools like snap-shot-it to locate associated snapshot files. The stack trace should contain a path to the original test file like: imports/jasmine/server/integration/autosplit.app-spec.js (confirmed with meteortesting:mocha)
Actual behavior: The filename in the stack trace running tests in coverage mode instead looks like /private/var/folders/q5/2qtj1b5n67b_q7czgc5mj8fh0000gn/T/meteor-test-run2kd6s4.yh47s/.meteor/local/build/programs/server/app/app.js
This causes the snapshot to not be able to locate it's required files in the original project directory.
The snap-shot-it package uses stacktrace-js to get the stack trace like so:
fullFilename = `${process.env.PWD}/${stackTrace.getSync()[1].fileName}`;
I don't think I can fix this. Maybe the variable process.env.PWD is not the right one to use with meteor-coverage?
What causes the inconsistency between coverage mode and non-coverage mode when running tests?
specifically why does it go from correctly referencing the original test file to the combined app.js?
I think that's always the case when you run babel-plugin-istanbul or any other coverage library. I use the source map after to retrieve the correct path