Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor(preprocessor): Update Source Map Handling This commit updates the handling of source map inclusion in the preprocessor. Instead of attempting to combine both the incoming source map and instrumented source map, a single one is chosen and included as an inline comment of the instrumented code. This commit also adds a null/undefined check before registering an incoming source map in the sourceMapStore. * chore(deps): Remove unused source-map package The previous commit removes the need for the source-map package. * test(preprocessor): Update test mocks This commit updates the instrumenter mock. Since the new logic calls instrumenter.lastSourceMap() in more cases, this has to be mocked properly. * fix(preprocessor): merging source maps This commit fixes an issue where karma would be unable to report correctly mapped stacktraces back to original sources. Instead of manually merging source maps, the default instrumenter, istanbul, supports passing in an input source map and having that merged automatically with the internal source map of instrumented code. The merged source map is now available for access using instrumenter.lastSourceMap(), so that is what file.sourceMap gets updated to (if the merge completed successfully). Istanbul reporting still requires the original source map only, so the check to register the source map with the source store is made before this merged source map is used. This allows istanbul to use the original incoming source map, while still allowing karma to use the merged source map.
- Loading branch information