-
Notifications
You must be signed in to change notification settings - Fork 3k
chore(code coverage): enable coverage remapping to source via sourcemap #557
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,22 @@ | ||
| var fs = require('fs-extra'); | ||
| var glob = require('glob'); | ||
| var jsonfile = require('jsonfile'); | ||
| var transfer = require('multi-stage-sourcemap').transfer; | ||
|
|
||
| glob('dist/es6/**/*.js.map', null, function (er, files) { | ||
| files.forEach(function (file) { | ||
| var source = jsonfile.readFileSync(file); | ||
| var destFile = file.replace('es6', 'cjs'); | ||
| var dest = jsonfile.readFileSync(destFile); | ||
|
|
||
| var transferred = transfer({ fromSourceMap: JSON.stringify(dest), | ||
| toSourceMap: JSON.stringify(source) }); | ||
|
|
||
| fs.unlink(destFile); | ||
| jsonfile.writeFile(destFile, transferred, function (err) { | ||
| if (err) { | ||
| console.log(err); | ||
| } | ||
| }); | ||
| }); | ||
| }); |
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -6,19 +6,20 @@ | |
| "scripts": { | ||
| "build_all": "npm run build_es6 && npm run build_amd && npm run build_cjs && npm run build_global", | ||
| "build_amd": "rm -rf dist/amd && tsc typings/es6-shim/es6-shim.d.ts src/Rx.ts -m amd --outDir dist/amd --sourcemap --target ES5", | ||
| "build_cjs": "rm -rf dist/cjs && babel dist/es6 --out-dir dist/cjs --modules common --sourceMaps --loose all && node lib/copy_dts.js", | ||
| "build_es6": "rm -rf dist/es6 && tsc src/Rx.ts src/Rx.KitchenSink.ts --outDir dist/es6 --target ES6 -d", | ||
| "build_cjs": "rm -rf dist/cjs && babel dist/es6 --out-dir dist/cjs --modules common --source-maps --loose all && node lib/copy_dts.js", | ||
| "build_es6": "rm -rf dist/es6 && tsc src/Rx.ts src/Rx.KitchenSink.ts --outDir dist/es6 --sourceMap --target ES6 -d", | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Found cjs / es6 modules didn't have sourcemap until now.. |
||
| "build_closure": "java -jar ./node_modules/google-closure-compiler/compiler.jar ./dist/global/Rx.js --create_source_map ./dist/global/Rx.min.js.map --js_output_file ./dist/global/Rx.min.js", | ||
| "build_global": "rm -rf dist/global && mkdir \"dist/global\" && browserify src/Rx.global.js --outfile dist/global/Rx.js && npm run build_closure", | ||
| "build_perf": "npm run build_es6 && npm run build_cjs && npm run build_global && webdriver-manager update && npm run perf", | ||
| "build_test": "rm -rf dist/ && npm run lint && npm run build_es6 && npm run build_cjs && jasmine", | ||
| "build_cover": "rm -rf dist/ && npm run lint && npm run build_es6 && npm run build_cjs && istanbul cover jasmine", | ||
| "build_cover": "rm -rf dist/ && npm run lint && npm run build_es6 && npm run build_cjs && npm run cover", | ||
| "build_docs": "./docgen.sh", | ||
| "lint_perf": "eslint perf/ --fix", | ||
| "lint_spec": "eslint spec/**/*.js --fix", | ||
| "lint_src": "tslint -c .tslintrc src/**/*.ts", | ||
| "lint": "npm run lint_src && npm run lint_spec && npm run lint_perf", | ||
| "cover": "istanbul cover jasmine", | ||
| "cover": "istanbul cover -x \"*-spec.js index.js *-helper.js\" jasmine && npm run cover_remapping", | ||
| "cover_remapping": "node lib/stage_sourcemap.js && remap-istanbul -i coverage/coverage.json -o coverage/coverage-remapped.json && remap-istanbul -i coverage/coverage.json -o coverage/coverage-remapped.lcov -t lcovonly && remap-istanbul -i coverage/coverage.json -o coverage/coverage-remapped -t html", | ||
| "test": "jasmine", | ||
| "watch": "watch \"echo triggering build && npm run build_test && echo build completed\" src -d -u -w=15", | ||
| "perf": "protractor protractor.conf.js", | ||
|
|
@@ -82,10 +83,13 @@ | |
| "istanbul": "0.3.22", | ||
| "jasmine": "2.3.2", | ||
| "jasmine-core": "2.3.4", | ||
| "jsonfile": "2.2.2", | ||
| "lodash": "3.5.0", | ||
| "multi-stage-sourcemap": "0.2.1", | ||
| "platform": "1.3.0", | ||
| "promise": "7.0.3", | ||
| "protractor": "2.2.0", | ||
| "remap-istanbul": "0.3.1", | ||
| "rx": "latest", | ||
| "tslint": "2.5.0", | ||
| "typescript": "1.8.0-dev.20151017", | ||
|
|
||
This file contains hidden or 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 |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| import Subject from '../Subject'; | ||
| import Subscriber from './Subscriber'; | ||
| import Subscriber from '../Subscriber'; | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typo correction - curious how tsc build was passed while module import path resolving fails. |
||
| import Subscription from '../Subscription'; | ||
| import Scheduler from '../Scheduler'; | ||
| import TestMessage from './TestMessage'; | ||
|
|
||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Travis doesn't seem to be running the check now... this line is suspect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I'm looking those part now. On my forked branch this works, failed here, continuing investigation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, it seems that
remap-istanbulisn't writing acoverage-remapped.lcovfile at all.