Skip to content

Instantly share code, notes, and snippets.

@magicmark
Created April 10, 2017 03:40
Show Gist options
  • Save magicmark/1f42671a313f75d3c83e6dd8b10f6c0a to your computer and use it in GitHub Desktop.
Save magicmark/1f42671a313f75d3c83e6dd8b10f6c0a to your computer and use it in GitHub Desktop.
nyc
diff --git a/.gitignore b/.gitignore
index b9b4c08..973b8b7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,8 +11,9 @@ pids
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
-# Coverage directory used by tools like istanbul
+# Coverage directories used by tools like istanbul
coverage
+.nyc_output
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
diff --git a/.istanbul.yml b/.istanbul.yml
deleted file mode 100644
index 78375cd..0000000
--- a/.istanbul.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-reporting:
- watermarks:
- statements: [50, 77]
- functions: [50, 74]
- branches: [50, 52]
- lines: [50, 82]
diff --git a/.nycrc b/.nycrc
new file mode 100644
index 0000000..68a0ab1
--- /dev/null
+++ b/.nycrc
@@ -0,0 +1,17 @@
+{
+ "lines": 82,
+ "functions": 68,
+ "branches": 52,
+ "statements": 76,
+ "reporter": [
+ "html",
+ "text-summary"
+ ],
+ "require": [
+ "babel-register"
+ ],
+ "exclude": [
+ "test"
+ ],
+ "check-coverage": true
+ }
diff --git a/package.json b/package.json
index 375ab89..ffc7d8a 100644
--- a/package.json
+++ b/package.json
@@ -8,10 +8,10 @@
"build": "rimraf lib && babel src -d lib",
"lint": "eslint src test",
"pretest": "npm run --silent lint",
- "test": "npm run build && npm run test:coverage && npm run --silent cover:check",
+ "test": "npm run test:coverage && npm run --silent cover:check",
"tests-only": "npm run build && npm run test:quick",
- "test:coverage": "babel-node node_modules/.bin/istanbul cover --report html node_modules/.bin/_mocha -- -R tap test/init.js test/*-test.js",
- "cover:check": "istanbul check-coverage && echo code coverage thresholds met, achievement unlocked!",
+ "test:coverage": "nyc --silent node_modules/.bin/_mocha -R tap test/init.js test/*-test.js",
+ "cover:check": "nyc report && echo code coverage thresholds met, achievement unlocked!",
"test:quick": "babel-node node_modules/.bin/_mocha -R tap test/init.js test/*-test.js"
},
"repository": {
diff --git a/server.js b/server.js
index 429f220..638a6fe 100644
--- a/server.js
+++ b/server.js
@@ -1 +1 @@
-module.exports = require('./lib/server.js');
+module.exports = require('./src/server.js');
diff --git a/test/BatchManager-test.js b/test/BatchManager-test.js
index 2de0a05..88a8aea 100644
--- a/test/BatchManager-test.js
+++ b/test/BatchManager-test.js
@@ -2,7 +2,7 @@ import { assert } from 'chai';
import sinon from 'sinon-sandbox';
import { makeJob, COMPONENT_NAME } from './helper';
-import BatchManager from '../lib/utils/BatchManager';
+import BatchManager from '../src/utils/BatchManager';
function mockPlugin() {
return {
diff --git a/test/lifecycle-test.js b/test/lifecycle-test.js
index 7a5d1b4..ca9b181 100644
--- a/test/lifecycle-test.js
+++ b/test/lifecycle-test.js
@@ -1,10 +1,10 @@
import { assert } from 'chai';
import sinon from 'sinon';
-import '../lib/environment';
+import '../src/environment';
import { makeJob } from './helper';
-import * as lifecycle from '../lib/utils/lifecycle';
-import BatchManager from '../lib/utils/BatchManager';
+import * as lifecycle from '../src/utils/lifecycle';
+import BatchManager from '../src/utils/BatchManager';
function mockPlugin() {
return {
diff --git a/test/renderBatch-test.js b/test/renderBatch-test.js
index 0fd20bf..6871fb9 100644
--- a/test/renderBatch-test.js
+++ b/test/renderBatch-test.js
@@ -1,5 +1,5 @@
import { assert } from 'chai';
-import renderBatch from '../lib/utils/renderBatch';
+import renderBatch from '../src/utils/renderBatch';
class Response {
status(status) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment