Skip to content

Commit 7207dba

Browse files
authored
Merge pull request #271 from KunalKapadia/develop-coverage-fix
Replace isparta with istanbul
2 parents a0b5bc1 + dc048ce commit 7207dba

File tree

8 files changed

+134
-85
lines changed

8 files changed

+134
-85
lines changed

.istanbul.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
verbose: false
22
instrumentation:
3-
excludes: ['dist/**', 'coverage/**', 'gulpfile.babel.js']
3+
excludes: ['dist/**', 'coverage/**', 'gulpfile.babel.js', 'config/env/development.js', 'config/env/production.js']
44
include-all-sources: true
55
reporting:
66
print: summary
@@ -21,5 +21,5 @@ check:
2121
each:
2222
statements: 50
2323
lines: 50
24-
branches: 50
24+
branches: 30
2525
functions: 20

.travis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
language: node_js
22
node_js:
3-
- "4.6"
3+
- "4.7"
44
- "6.9"
5-
- "7.2"
5+
- "7.5"
66
services:
77
- mongodb
88
cache:
99
directories:
1010
- node_modules
1111
git:
1212
depth: 3
13+
script:
14+
- yarn test:check-coverage
1315
after_script:
1416
- yarn report-coverage

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,12 @@ Refer [debug](https://www.npmjs.com/package/debug) to know how to selectively tu
6868

6969
Tests:
7070
```sh
71-
# Run tests written in ES6 along with code coverage
71+
# Run tests written in ES6
7272
yarn test
7373

74+
# Run test along with code coverage
75+
yarn test:coverage
76+
7477
# Run tests on file change
7578
yarn test:watch
7679

config/env/development.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
export default {
1+
const devConfig = {
22
env: 'development',
33
MONGOOSE_DEBUG: true,
44
jwtSecret: '0a6b944d-d2fb-46fc-a85e-0295c986cd9f',
55
db: 'mongodb://localhost/express-mongoose-es6-rest-api-development',
66
port: 4040
77
};
8+
9+
export default devConfig;

config/env/production.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
export default {
1+
const prodConfig = {
22
env: 'production',
33
jwtSecret: '0a6b944d-d2fb-46fc-a85e-0295c986cd9f',
44
db: 'mongodb://localhost/express-mongoose-es6-rest-api-production',
55
port: 4040
66
};
7+
8+
export default prodConfig;

config/env/test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
export default {
1+
const testConfig = {
22
env: 'test',
33
jwtSecret: '0a6b944d-d2fb-46fc-a85e-0295c986cd9f',
44
db: 'mongodb://localhost/express-mongoose-es6-rest-api-test',
55
port: 4040
66
};
7+
8+
export default testConfig;

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515
"build": "gulp",
1616
"lint": "esw *.js server config --color",
1717
"lint:watch": "yarn lint -- --watch",
18-
"test": "cross-env NODE_ENV=test babel-node node_modules/.bin/isparta cover _mocha -- --ui bdd --reporter spec --colors --compilers js:babel-core/register ./server/**/*.test.js",
18+
"test": "cross-env NODE_ENV=test ./node_modules/.bin/mocha --ui bdd --reporter spec --colors --compilers js:babel-core/register ./server/**/*.test.js",
1919
"test:watch": "yarn test -- --watch",
20-
"test:check-coverage": "yarn test && istanbul check-coverage",
20+
"test:coverage": "cross-env NODE_ENV=test ./node_modules/.bin/istanbul cover _mocha -- --ui bdd --reporter spec --colors --compilers js:babel-core/register ./server/**/*.test.js",
21+
"test:check-coverage": "yarn test:coverage && istanbul check-coverage",
2122
"report-coverage": "coveralls < ./coverage/lcov.info"
2223
},
2324
"repository": {
@@ -81,8 +82,7 @@
8182
"gulp-nodemon": "^2.0.6",
8283
"gulp-sourcemaps": "^1.6.0",
8384
"gulp-util": "^3.0.7",
84-
"isparta": "4.0.0",
85-
"istanbul": "0.4.5",
85+
"istanbul": "1.1.0-alpha.1",
8686
"mocha": "3.2.0",
8787
"run-sequence": "^1.1.5",
8888
"supertest": "2.0.1",

0 commit comments

Comments
 (0)