Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Commit b049523

Browse files
committed
Use combined coverage
1 parent 20f68e2 commit b049523

File tree

4 files changed

+16
-14
lines changed

4 files changed

+16
-14
lines changed

.travis.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@ before_install:
1717
before_script:
1818
- npm prune
1919
script:
20-
- npm run lint
21-
- npm run test:coverage
22-
- npm run test:integration
23-
- npm run build
20+
- npm run all
2421
after_success:
2522
- npm run ci:coveralls
2623
deploy:

karma.conf.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ module.exports = (config) => {
1414
"tests.webpack.js": ["webpack", "sourcemap"],
1515
},
1616
remapCoverageReporter: {
17-
"text-summary": null,
17+
text: null,
18+
lcovonly: "./coverage/lcov-integration.info",
1819
// json: './coverage/coverage.json',
1920
// html: './coverage/html'
2021
},
@@ -23,8 +24,7 @@ module.exports = (config) => {
2324
{ type: "in-memory" },
2425
],
2526
},
26-
// TODO: enable coverage after https://github.com/deepsweet/istanbul-instrumenter-loader/pull/29.
27-
reporters: ["dots"], // , "coverage", "remap-coverage"], // report results in this format
27+
reporters: ["dots", "coverage", "remap-coverage"],
2828
webpack: {
2929
resolve: {
3030
extensions: [".tsx", ".ts", ".js", ".json"],

package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919
"main": "./cjs/index.js",
2020
"typings": "./lib/index.d.ts",
2121
"scripts": {
22+
"all": "npm run lint && npm run test && npm run build",
2223
"build": "gulp && webpack && cross-env BUILD_MINIFIED=true webpack",
2324
"clean": "rm -r -f dist lib cjs coverage",
24-
"ci:coveralls": "cat coverage/lcov.info | coveralls",
25+
"ci:coveralls": "lcov-result-merger './coverage/lcov*.info' | coveralls",
2526
"release": "npm version -m 'react-css-transition release %s'",
2627
"lint": "gulp lint",
2728
"test": "npm run test:unit && npm run test:integration",
28-
"test:coverage": "cross-env TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' istanbul cover node_modules/.bin/_mocha -- --opts mocha.opts",
29-
"test:unit": "cross-env TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' mocha --opts mocha.opts",
29+
"test:unit": "cross-env TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' istanbul cover node_modules/.bin/_mocha -- --opts mocha.opts",
3030
"test:unit:watch": "npm run test:unit -- --watch",
3131
"test:integration": "karma start",
3232
"test:integration:watch": "karma start --single-run=false"
@@ -72,22 +72,24 @@
7272
"gulp-typescript": "^3.1.3",
7373
"gulp-yaml-validate": "^1.0.2",
7474
"istanbul": "^1.1.0-alpha.1",
75-
"istanbul-instrumenter-loader": "^1.0.0",
75+
"istanbul-instrumenter-loader": "^1.1.0",
7676
"jsdom": "^9.8.0",
7777
"json-loader": "^0.5.4",
7878
"karma": "^1.3.0",
7979
"karma-chrome-launcher": "^2.0.0",
8080
"karma-coverage": "^1.1.1",
8181
"karma-mocha": "^1.2.0",
8282
"karma-mocha-reporter": "^2.2.0",
83-
"karma-remap-coverage": "^0.1.2",
83+
"karma-remap-coverage": "^0.1.3",
8484
"karma-sourcemap-loader": "^0.3.7",
8585
"karma-webpack": "^1.8.0",
86+
"lcov-result-merger": "^1.2.0",
8687
"merge2": "^1.0.2",
8788
"mocha": "^3.1.2",
8889
"react": "^15.3.2",
8990
"react-addons-test-utils": "^15.3.2",
9091
"react-dom": "^15.3.2",
92+
"remap-istanbul": "0.8.0",
9193
"sinon": "^2.0.0-pre.4",
9294
"ts-node": "~1.2.3",
9395
"tslint": "^4.1.1",

tests.webpack.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
"use strict";
22

3-
const integrationContext = require.context("./test", true, /\.tsx?$/);
4-
integrationContext.keys().forEach(integrationContext);
3+
const srcContext = require.context("./src", true, /^(?!.*\.spec\.).*\.tsx?$/);
4+
srcContext.keys().forEach(srcContext);
5+
6+
const testContext = require.context("./test", true, /\.tsx?$/);
7+
testContext.keys().forEach(testContext);

0 commit comments

Comments
 (0)