Skip to content

Commit 2b77248

Browse files
committed
build: use nyc for test coverage
1 parent 886605c commit 2b77248

File tree

6 files changed

+12
-134
lines changed

6 files changed

+12
-134
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.nyc_output
12
coverage
23
node_modules
34
npm-debug.log

.travis.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,17 @@ cache:
1717
- node_modules
1818
before_install:
1919
# Setup Node.js version-specific dependencies
20-
- "test $TRAVIS_NODE_VERSION != '0.6' || npm rm --save-dev istanbul"
21-
- "test $TRAVIS_NODE_VERSION != '0.8' || npm rm --save-dev istanbul"
20+
- "test $TRAVIS_NODE_VERSION != '0.6' || npm rm --save-dev nyc"
21+
- "test $TRAVIS_NODE_VERSION != '0.8' || npm rm --save-dev nyc"
2222
- "test $(echo $TRAVIS_NODE_VERSION | cut -d'.' -f1) -ge 4 || npm rm --save-dev eslint"
2323
# Update Node.js modules
2424
- "test ! -d node_modules || npm prune"
2525
- "test ! -d node_modules || npm rebuild"
2626
script:
27-
# Run test script, depending on istanbul install
28-
- "test ! -z $(npm -ps ls istanbul) || npm test"
29-
- "test -z $(npm -ps ls istanbul) || npm run-script test-ci"
27+
# Run test script, depending on nyc install
28+
- "test ! -z $(npm -ps ls nyc) || npm test"
29+
- "test -z $(npm -ps ls nyc) || npm run-script test-ci"
30+
# Run linter
3031
- "test -z $(npm -ps ls eslint) || npm run-script lint"
3132
after_script:
32-
- "test -e ./coverage/lcov.info && npm install coveralls@2 && cat ./coverage/lcov.info | coveralls"
33+
- "test -d .nyc_output && npm install coveralls@2 && nyc report --reporter=text-lcov | coveralls"

package.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@
1818
"repository": "mysqljs/sqlstring",
1919
"devDependencies": {
2020
"eslint": "3.18.0",
21-
"istanbul": "0.4.5",
22-
"mkdirp": "0.5.1",
23-
"require-all": "2.2.0",
24-
"rimraf": "2.2.8",
21+
"nyc": "10.2.0",
2522
"urun": "0.0.8",
2623
"utest": "0.0.8"
2724
},
@@ -38,7 +35,7 @@
3835
"scripts": {
3936
"lint": "eslint .",
4037
"test": "node test/run.js",
41-
"test-ci": "node test/run-cov.js lcovonly",
42-
"test-cov": "node test/run-cov.js"
38+
"test-ci": "nyc --reporter=text npm test",
39+
"test-cov": "nyc --reporter=html --reporter=text npm test"
4340
}
4441
}

test/common.js

Lines changed: 0 additions & 28 deletions
This file was deleted.

test/run-cov.js

Lines changed: 0 additions & 93 deletions
This file was deleted.

test/unit/test-SqlString.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
var assert = require('assert');
2-
var SqlString = require('../common').SqlString;
2+
var SqlString = require('../../');
33
var test = require('utest');
44

55
test('SqlString.escapeId', {

0 commit comments

Comments
 (0)