From 81bf648d959b974cfd8483115c65a559ba9018c9 Mon Sep 17 00:00:00 2001 From: Dan Farrelly Date: Tue, 12 Jul 2016 15:58:25 -0400 Subject: [PATCH] Add code coverage with Istanbul --- .gitignore | 3 ++- package.json | 7 ++++--- test/email.js | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 0439905a..5b958f03 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,10 @@ .DS_Store .sass-cache node_modules +coverage dist .zip maildev-* settings.json *.sublime-* -.nodemonignore \ No newline at end of file +.nodemonignore diff --git a/package.json b/package.json index 2cf79f4d..fe8723d5 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,9 @@ "type": "git", "url": "http://github.com/djfarrelly/maildev.git" }, + "scripts": { + "test": "./node_modules/.bin/istanbul cover _mocha" + }, "main": "./index.js", "bin": { "maildev": "./bin/maildev" @@ -45,6 +48,7 @@ "grunt-nodemon": "^0.4.0", "grunt-sass": "^1.1.0", "http-proxy-middleware": "^0.12.0", + "istanbul": "^0.4.4", "matchdep": "^1.0.1", "mocha": "^2.2.5", "nodemailer": "^2.3.0", @@ -52,8 +56,5 @@ }, "engines": { "node": ">=0.10.0" - }, - "scripts": { - "test": "./node_modules/mocha/bin/mocha" } } diff --git a/test/email.js b/test/email.js index 342f9219..6d11dd3d 100644 --- a/test/email.js +++ b/test/email.js @@ -47,7 +47,7 @@ describe('email', function() { assert.equal(html, ''); - // Pass baseUrl + // Pass baseUrl maildev.getEmailHTML(email.id, 'localhost:8080', function(err, html) { assert.equal(html, '');