diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 9091f94..d25886c 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -10,3 +10,11 @@ _Put an `x` in the boxes that apply_ Describe the nature of this change. What problem does it address? +## Checklist +_Put an `x` in the boxes that apply_ + +- [ ] I have read the [contribution guidelines](https://github.com/node-red/node-red/blob/master/CONTRIBUTING.md) +- [ ] For non-bugfix PRs, I have discussed this change on the mailing list/slack team. +- [ ] I have run `grunt` to verify the unit tests pass +- [ ] I have added suitable unit tests to cover the new/changed functionality + diff --git a/.gitignore b/.gitignore index 1c291f8..126f547 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,9 @@ node-red-node-* # Dependency directory node_modules + +# Coverage result +coverage + +# npm install log +npm-debug.log.* diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..574685a --- /dev/null +++ b/.travis.yml @@ -0,0 +1,21 @@ +sudo: false +language: node_js +env: + - CXX="g++-4.8" +addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-4.8 + - gcc-4.8 +node_js: + - "8" + - "7" + - "6" + - "4" +script: + - istanbul cover ./node_modules/.bin/grunt --report lcovonly && istanbul report text && ( cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js || true ) && rm -rf coverage +before_script: + - npm install -g istanbul + - npm install coveralls diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 0000000..23ffcaf --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,25 @@ +module.exports = function (grunt) { + grunt.initConfig({ + simplemocha: { + options: { + timeout: 3000 + }, + all: { + src: [ 'test/**/*_spec.js' ] + } + }, + mocha_istanbul: { + options: { + timeout: 3000 + }, + coverage: { + src: [ 'test/**/*_spec.js' ] + } + } + }); + grunt.loadNpmTasks('grunt-simple-mocha'); + grunt.loadNpmTasks('grunt-mocha-istanbul'); + grunt.registerTask('default', ['simplemocha']); + grunt.registerTask('coverage', 'Run Istanbul code test coverage task', ['mocha_istanbul']); +}; + diff --git a/package.json b/package.json index 122fb2a..62b803d 100644 --- a/package.json +++ b/package.json @@ -52,6 +52,13 @@ "minimist": "1.2.0", "colors": "1.1.2" }, + "devDependencies": { + "grunt": "1.0.1", + "grunt-simple-mocha": "0.4.1", + "grunt-mocha-istanbul": "5.0.2", + "should": "13.1.3", + "del": "3.0.0" + }, "bin": { "node-red-nodegen": "./bin/node-red-nodegen.js" }