Skip to content

Instantly share code, notes, and snippets.

@StickyCube
Last active December 8, 2017 18:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save StickyCube/45ea4e92d24c5b7a3a852c5e627c5613 to your computer and use it in GitHub Desktop.
Save StickyCube/45ea4e92d24c5b7a3a852c5e627c5613 to your computer and use it in GitHub Desktop.
{
"include": [
"foo.js"
],
"reporter": "text-lcov"
}
module.exports = function (a, b) {
return a + b;
}
{
"name": "test-nyc",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"mocha": "4.0.1",
"nyc": "11.3.0"
},
"scripts": {
"test": "mocha spec.js",
"test:coverage": "nyc npm t"
}
}
const foo = require('./foo.js');
const assert = require('assert');
it('Passes', () => {
let actual = foo(1, 1);
let expected = 2;
assert.equal(actual, expected);
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment