|
30 | 30 | "test-backend": "better-npm-run test-backend",
|
31 | 31 | "test-frontend": "better-npm-run test-frontend",
|
32 | 32 | "test-e2e": "echo \"E2E tests are coming soon...\"",
|
33 |
| - "coverage": "better-npm-run coverage", |
| 33 | + "coverage": "better-npm-run coverage-backend && mv coverage/coverage.raw.json coverage/coverage.backend.raw.json && better-npm-run coverage-frontend && mv coverage/coverage.raw.json coverage/coverage.frontend.raw.json && istanbul-merge --out coverage/coverage.raw.json coverage/coverage.backend.raw.json coverage/coverage.frontend.raw.json", |
34 | 34 | "lint": "eslint ."
|
35 | 35 | },
|
36 | 36 | "betterScripts": {
|
|
52 | 52 | "test-backend": {
|
53 | 53 | "command": "mocha --compilers js:babel-core/register \"./backend/__tests__/**/*@(.js|.jsx)\" --timeout 5000",
|
54 | 54 | "env": {
|
| 55 | + "NODE_PATH": "./backend", |
55 | 56 | "NODE_ENV": "test",
|
56 | 57 | "PORT": 3030
|
57 | 58 | }
|
58 | 59 | },
|
59 | 60 | "test-frontend": {
|
60 |
| - "command": "mocha --compilers js:babel-core/register \"./frontend/__tests__/**/*@(.js|.jsx)\" --timeout 5000", |
| 61 | + "command": "mocha --webpack-config webpack.config-test.js --compilers js:babel-core/register --require ignore-styles --require ./frontend/__tests__/helper.js \"frontend/**/*.test@(.js|.jsx)\" --timeout 5000", |
61 | 62 | "env": {
|
| 63 | + "NODE_PATH": "./frontend", |
62 | 64 | "NODE_ENV": "test",
|
63 |
| - "PORT": 3030 |
| 65 | + "PORT": 3000 |
64 | 66 | }
|
65 | 67 | },
|
66 |
| - "coverage": { |
67 |
| - "command": "istanbul cover _mocha -- --compilers js:babel-core/register \"./@(backend|frontend)/__tests__/**/*@(.js|.jsx)\" --timeout 5000", |
| 68 | + "coverage-backend": { |
| 69 | + "command": "istanbul --include-all-sources cover _mocha -- --compilers js:babel-core/register \"./backend/__tests__/**/*@(.js|.jsx)\" --timeout 5000", |
68 | 70 | "env": {
|
| 71 | + "NODE_PATH": "./backend", |
69 | 72 | "NODE_ENV": "test",
|
70 | 73 | "PORT": 3030
|
71 | 74 | }
|
| 75 | + }, |
| 76 | + "coverage-frontend": { |
| 77 | + "command": "istanbul --include-all-sources cover _mocha -- --compilers js:babel-core/register --require ignore-styles --require ./frontend/__tests__/helper.js \"frontend/**/*.test@(.js|.jsx)\" --timeout 5000", |
| 78 | + "env": { |
| 79 | + "NODE_PATH": "./frontend", |
| 80 | + "NODE_ENV": "test", |
| 81 | + "PORT": 3000 |
| 82 | + } |
72 | 83 | }
|
73 | 84 | },
|
74 | 85 | "dependencies": {
|
|
135 | 146 | "eslint-plugin-jsx-a11y": "^2.2.3",
|
136 | 147 | "eslint-plugin-react": "^6.8.0",
|
137 | 148 | "file-loader": "^0.9.0",
|
| 149 | + "ignore-styles": "^5.0.1", |
138 | 150 | "istanbul": "^1.1.0-alpha.1",
|
| 151 | + "istanbul-merge": "^1.1.1", |
139 | 152 | "jsdom": "^9.9.1",
|
140 | 153 | "mocha": "^3.2.0",
|
141 | 154 | "mockgoose": "^6.0.8",
|
|
0 commit comments