-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include input source map in file coverage
Add an option to include an input source map. The input source map is the source map that maps the code before its instumentation back it's original form. This is needed to support more complex setups, e.g. when bundlers are involved. If a bundler like webpack, browserify - or you name it - is used, then there are several, intermediate, source maps involved. The main issue is, that the instrumented code is bundled into a single file, and therefore a new source map is created. But the source map of the bundled file cannot be used to remap the istanbul coverage. Therefore, these intermediate source maps need to be stored to be available when creating the report or remaping. This solution is kind of hacky and should start a discussion how to solve it best. Anyway, it fixes variouis issues that, up to now, required hacky solutions. refs SitePen/remap-istanbul#2
- Loading branch information
Micha Reiser
committed
Nov 7, 2016
1 parent
71134b6
commit 8d70de9
Showing
7 changed files
with
66 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
name: defined input source map | ||
code: | | ||
output = "test" | ||
inputSourceMap: { file: "test.js", mappings: "", names: [], sourceRoot: undefined, sources: [ "test.js" ], sourcesContent: [ 'output = "test"' ], version: 3 } | ||
tests: | ||
- name: sets the input source map | ||
args: [] | ||
out: "test" | ||
lines: { '1': 1 } | ||
statements: { '1': 1 } | ||
inputSourceMap: { file: "test.js", mappings: "", names: [], sourceRoot: undefined, sources: [ "test.js" ], sourcesContent: [ 'output = "test"' ], version: 3 } | ||
--- | ||
name: without input source map | ||
code: | | ||
output = "test" | ||
inputSourceMap: undefined | ||
tests: | ||
- name: is not set on the coverage object | ||
args: [] | ||
out: "test" | ||
lines: { '1': 1 } | ||
statements: { '1': 1 } | ||
inputSourceMap: undefined |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters