diff --git a/Makefile b/Makefile deleted file mode 100644 index 7ad8dccdc..000000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -MOCHA_OPTS= -TESTS = test/* -REPORTER = dot -TIMEOUT = 6000 - -test: - @./node_modules/.bin/mocha \ - --reporter $(REPORTER) --timeout $(TIMEOUT) $(TESTS) \ - $(MOCHA_OPTS) - -test-cov: lib-cov - @POMELO_COV=1 $(MAKE) test REPORTER=html-cov > coverage.html - -lib-cov: - @jscoverage lib lib-cov - -clean: - rm -f coverage.html - rm -fr lib-cov - -.PHONY: test clean \ No newline at end of file diff --git a/coverage/blanket.js b/coverage/blanket.js new file mode 100644 index 000000000..87389f590 --- /dev/null +++ b/coverage/blanket.js @@ -0,0 +1,6 @@ +var path = require('path'); +var srcDir = path.join(__dirname, '..', 'lib'); + +require('blanket')({ + pattern: srcDir +}); \ No newline at end of file diff --git a/gruntfile.js b/gruntfile.js index e45e43a4d..0ac78afa0 100644 --- a/gruntfile.js +++ b/gruntfile.js @@ -12,8 +12,6 @@ module.exports = function(grunt) { // Project configuration. grunt.initConfig({ - // Metadata. - pkg: grunt.file.readJSON('package.json'), jscoverage: { options: { inputDirectory: 'lib', @@ -21,10 +19,10 @@ module.exports = function(grunt) { } }, mochaTest: { - dot: { + test: { options: { - reporter: 'dot', - timeout: 5000 + reporter: 'spec', + require: 'coverage/blanket' }, src: src }, @@ -51,10 +49,5 @@ module.exports = function(grunt) { }); // Default task. - grunt.registerTask('default', ['clean', 'jscoverage', 'mochaTest:dot', 'jshint:all']); - - grunt.registerTask('test-cov', 'run mocha html-cov reporter to coverage.html', function() { - process.env.POMELO_COV = 1; - grunt.task.run(['mochaTest:coverage']); - }); + grunt.registerTask('default', ['clean', 'jscoverage', 'mochaTest', 'jshint:all']); }; \ No newline at end of file diff --git a/index.js b/index.js index 4a11b0149..f6ce1b74a 100644 --- a/index.js +++ b/index.js @@ -1,3 +1 @@ -module.exports = process.env.POMELO_COV ? - require('./lib-cov/pomelo') : - require('./lib/pomelo'); \ No newline at end of file +module.exports = require('./lib/pomelo'); \ No newline at end of file diff --git a/package.json b/package.json index bfd013243..58856c9c2 100644 --- a/package.json +++ b/package.json @@ -59,6 +59,7 @@ "grunt-mocha-test": "0.8.x", "grunt-jscoverage": "0.0.3", "grunt-contrib-clean": "0.5.x", - "grunt-contrib-jshint": "~0.8.0" + "grunt-contrib-jshint": "~0.8.0", + "blanket": "~1.1.6" } -} \ No newline at end of file +}