Add support for coverage files relative to shifter config #101
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've recently been trying to build coverage reports from shifted modules and hit this issue on the way.
At present, all coverage files are built with the name and filename set as:
When istanbul then comes along to produce the report, it tries to find the source files at this path; however, when building in a recursive or distributed situation and where build is not in your immediate path, this leads to unresolvable .js files.
This change sets an internal relativeTo option to shifter which is then used when instrumenting the -coverage.js files so that each file is built relative to the configuration. This is only done when the configuration file:
coverageRelativeToConfig: true
In a nested structure such as:
Instead of the path being set to:
It will be set to
When it comes to creating the istanbul reports, this is now resolvable.