summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--.istanbul.yml2
-rw-r--r--package.json3
-rw-r--r--tasks/test.js13
4 files changed, 17 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index 0e32d04..3c6d099 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,6 +4,7 @@ vendor
lib/handlebars/compiler/parser.js
/dist/
/tmp/
+/coverage/
node_modules
*.sublime-project
*.sublime-workspace
diff --git a/.istanbul.yml b/.istanbul.yml
new file mode 100644
index 0000000..e6911f1
--- /dev/null
+++ b/.istanbul.yml
@@ -0,0 +1,2 @@
+instrumentation:
+ excludes: ['**/spec/**']
diff --git a/package.json b/package.json
index ea8ca56..8e69350 100644
--- a/package.json
+++ b/package.json
@@ -32,6 +32,7 @@
"benchmark": "~1.0",
"dustjs-linkedin": "~2.0.2",
"eco": "~1.1.0-rc-3",
+ "es6-module-packager": "1.x",
"grunt": "~0.4.1",
"grunt-cli": "~0.1.10",
"grunt-contrib-clean": "~0.4.1",
@@ -43,7 +44,7 @@
"grunt-contrib-uglify": "~0.2.2",
"grunt-contrib-watch": "~0.5.3",
"grunt-saucelabs": "8.x",
- "es6-module-packager": "1.x",
+ "istanbul": "^0.3.0",
"jison": "~0.3.0",
"keen.io": "0.0.3",
"mocha": "~1.20.0",
diff --git a/tasks/test.js b/tasks/test.js
index 664af60..ad8a911 100644
--- a/tasks/test.js
+++ b/tasks/test.js
@@ -29,5 +29,16 @@ module.exports = function(grunt) {
done();
});
});
- grunt.registerTask('test', ['test:bin', 'test:mocha']);
+ grunt.registerTask('test:cov', function() {
+ var done = this.async();
+
+ var runner = childProcess.fork('node_modules/.bin/istanbul', ['cover', '--', './spec/env/runner.js'], {stdio: 'inherit'});
+ runner.on('close', function(code) {
+ if (code != 0) {
+ grunt.fatal(code + ' tests failed');
+ }
+ done();
+ });
+ });
+ grunt.registerTask('test', ['test:bin', 'test:cov']);
};