From c836f93a5e56278005311bf4380f05a53e30fea0 Mon Sep 17 00:00:00 2001 From: unpregnant Date: Thu, 16 Feb 2017 19:38:18 +0100 Subject: [PATCH] ADD istanbul for code coverage --- .gitignore | 1 + package.json | 7 +++---- test/Config.js | 9 +++++++++ test/files/writeFile.txt | 2 +- 4 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 test/Config.js diff --git a/.gitignore b/.gitignore index af79f2c..2fb8868 100755 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ npm-debug.* node_modules electroshot-config.json +.nyc_output/ diff --git a/package.json b/package.json index 006ce1c..9e16c26 100755 --- a/package.json +++ b/package.json @@ -22,12 +22,11 @@ "server": "node --harmony-async-await src/app.js", "less": "node --harmony-async-await src/less.js", "babel": "babel --presets es2015 src/public/javascript.js -o public/javascript.js", - "readme": "node --harmony-async-await src/RenderReadMe.js", "start": "npm run babel && npm run less && npm run server", "dev": "watch 'npm start' src/ resumes/ less/", "pdf": "npm run babel && npm run less && node --harmony-async-await src/generatePdfs.js", "lint": "eslint src/", - "test": "mocha --harmony-async-await \"test/*.js\"", + "test": "nyc mocha --harmony-async-await \"test/*.js\"", "istanbul": "istanbul cover node_modules/.bin/_mocha -- -- -u exports test/**/* --harmony-async-await" }, "dependencies": { @@ -68,7 +67,7 @@ }, "devDependencies": { "eslint": "3.15.0", - "istanbul": "^0.4.5", - "mocha": "3.2.0" + "mocha": "3.2.0", + "nyc": "10.1.2" } } diff --git a/test/Config.js b/test/Config.js new file mode 100644 index 0000000..479a587 --- /dev/null +++ b/test/Config.js @@ -0,0 +1,9 @@ +/* global it, describe */ +const assert = require('assert'); +const Config = require('../src/Config'); +describe('Config', () => { + it('should have property port', () => { + assert(Config.port != null); + assert(typeof Config.port == 'number'); + }); +}); diff --git a/test/files/writeFile.txt b/test/files/writeFile.txt index 3bb775a..c4ec6b8 100644 --- a/test/files/writeFile.txt +++ b/test/files/writeFile.txt @@ -1 +1 @@ -alskldjaksldjaklsjdla0.6817729887314716 \ No newline at end of file +alskldjaksldjaklsjdla0.4110614003605342 \ No newline at end of file