diff --git a/.travis.yml b/.travis.yml index 0659764..089c229 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,10 +8,10 @@ addons: matrix: include: - node_js: "10" + script: + - ./node_modules/.bin/grunt && istanbul report text && ( cat coverage/lcov.info | $(npm get prefix)/bin/coveralls || true ) && rm -rf coverage - node_js: "8" - node_js: "6" -script: - - istanbul cover ./node_modules/.bin/grunt --report lcovonly && istanbul report text && ( cat coverage/lcov.info | $(npm get prefix)/bin/coveralls || true ) && rm -rf coverage before_script: - docker pull swaggerapi/petstore - docker run -d -e SWAGGER_URL=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore diff --git a/Gruntfile.js b/Gruntfile.js index 5505514..05842ed 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -41,7 +41,7 @@ module.exports = function (grunt) { options: { timeout: 3000 }, - coverage: { + all: { src: [ 'test/**/*_spec.js' ] } } @@ -50,6 +50,6 @@ module.exports = function (grunt) { grunt.loadNpmTasks('grunt-shell'); grunt.loadNpmTasks('grunt-simple-mocha'); grunt.loadNpmTasks('grunt-mocha-istanbul'); - grunt.registerTask('default', ['shell', 'simplemocha']); - grunt.registerTask('coverage', 'Run Istanbul code test coverage task', ['shell', 'mocha_istanbul']); + grunt.registerTask('default', ['shell', 'mocha_istanbul:all']); + grunt.registerTask('coverage', 'Run Istanbul code test coverage task', ['shell', 'mocha_istanbul:all']); }; diff --git a/package.json b/package.json index 5f8f80e..3d414fa 100644 --- a/package.json +++ b/package.json @@ -71,6 +71,7 @@ "grunt-shell": "2.1.0", "grunt-simple-mocha": "0.4.1", "grunt-mocha-istanbul": "5.0.2", + "istanbul": "0.4.5", "should": "13.1.3", "node-red": "0.18.7", "node-red-node-test-helper": "0.1.8", @@ -81,5 +82,8 @@ }, "bin": { "node-red-nodegen": "./bin/node-red-nodegen.js" + }, + "scripts": { + "test": "grunt" } }