Skip to content

Commit

Permalink
chore(code coverage): enable coverage remapping to source via sourcemap
Browse files Browse the repository at this point in the history
- update script enables test coverage remapping to original (es6) source
- minor update to document, code
  • Loading branch information
kwonoj authored and benlesh committed Oct 26, 2015
1 parent e35ae9b commit 36dcfda
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ script:
- npm run build_cover

after_script:
- cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
- ./node_modules/.bin/remap-istanbul -i coverage/coverage.json -o coverage/coverage-remapped.json && ./node_modules/.bin/remap-istanbul -i coverage/coverage.json -o coverage/coverage-remapped.lcov -t lcovonly && ./node_modules/.bin/remap-istanbul -i coverage/coverage.json -o coverage/coverage-remapped -t html
- cat ./coverage/coverage-remapped.lcov | ./node_modules/coveralls/bin/coveralls.js
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ The build and test structure is fairly primitive at the moment. There are variou
- build_test: builds ES6, then CommonJS, then runs the tests with `jasmine`
- build_perf: builds ES6, CommonJS, then global, then runs the performance tests with `protractor`
- build_docs: generates API documentation from `dist/es6` to `dist/docs`
- build_cover: runs `istanbul` code coverage against test cases
- test: runs tests with `jasmine`, must have built prior to running.

### Example
Expand All @@ -65,6 +66,7 @@ npm run build_all
## Performance Tests

Run `npm run build_perf` or `npm run perf` to run the performance tests with `protractor`.
Run `npm run perf_micro` to run micro performance test benchmarking operator.

## Adding documentation
RxNext uses [ESDoc](https://esdoc.org/) to generate API documentation. Refer to ESDoc's documentation for syntax. Run `npm run build_docs` to generate.
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
"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",
"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",
"test": "jasmine",
"watch": "watch \"echo triggering build && npm run build_test && echo build completed\" src -d -u -w=15",
"perf": "protractor protractor.conf.js",
Expand Down Expand Up @@ -86,6 +86,7 @@
"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",
Expand Down
2 changes: 1 addition & 1 deletion src/testing/HotObservable.ts
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';
import Subscription from '../Subscription';
import Scheduler from '../Scheduler';
import TestMessage from './TestMessage';
Expand Down

0 comments on commit 36dcfda

Please sign in to comment.