diff --git a/.gitignore b/.gitignore index 737dad19..53cb59c2 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ dist/ openpgp.store/ doc/ browserify-cache*.json +.nyc_output/ diff --git a/Gruntfile.js b/Gruntfile.js index 7044ff9e..b4f19f50 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -103,6 +103,23 @@ module.exports = function(grunt) { } } }, + nyc: { + cover: { + options: { + include: ['dist/**'], + reporter: ['text-summary'], + reportDir: 'coverage' + }, + cmd: false, + args: ['grunt', 'mochaTest'], + sourceMap: true + }, + report: { + options: { + reporter: 'text' + } + } + }, replace: { openpgp: { src: ['dist/openpgp.js'], @@ -200,15 +217,6 @@ module.exports = function(grunt) { } } }, - mocha_istanbul: { - coverage: { - src: 'test', - options: { - root: '.', - timeout: 240000 - } - } - }, mochaTest: { unittests: { options: { @@ -285,12 +293,12 @@ module.exports = function(grunt) { grunt.loadNpmTasks('grunt-jsbeautifier'); grunt.loadNpmTasks('grunt-jsdoc'); grunt.loadNpmTasks('gruntify-eslint'); - grunt.loadNpmTasks('grunt-mocha-istanbul'); grunt.loadNpmTasks('grunt-mocha-test'); grunt.loadNpmTasks('grunt-contrib-copy'); grunt.loadNpmTasks('grunt-contrib-clean'); grunt.loadNpmTasks('grunt-contrib-connect'); grunt.loadNpmTasks('grunt-contrib-watch'); + grunt.loadNpmTasks('grunt-simple-nyc'); grunt.registerTask('set_version', function() { if (!version) { @@ -340,6 +348,6 @@ module.exports = function(grunt) { grunt.registerTask('default', ['build']); // Test/Dev tasks grunt.registerTask('test', ['eslint', 'mochaTest']); - grunt.registerTask('coverage', ['mocha_istanbul:coverage']); + grunt.registerTask('coverage', ['nyc']); grunt.registerTask('browsertest', ['build', 'browserify:unittests', 'copy:browsertest', 'connect:test', 'watch']); }; diff --git a/package.json b/package.json index 9ecd51b6..c8c74b25 100644 --- a/package.json +++ b/package.json @@ -60,13 +60,13 @@ "grunt-header": "^1.1.0", "grunt-jsbeautifier": "^0.2.13", "grunt-jsdoc": "^2.2.1", - "grunt-mocha-istanbul": "^5.0.2", "grunt-mocha-test": "^0.13.3", + "grunt-simple-nyc": "^3.0.1", "grunt-terser": "^0.1.0", "grunt-text-replace": "~0.4.0", "gruntify-eslint": "^4.0.0", - "istanbul": "^0.4.5", "mocha": "^5.0.0", + "nyc": "^14.1.1", "sinon": "^4.3.0", "text-encoding-utf-8": "^1.0.2", "whatwg-fetch": "^2.0.3",