diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..8e690733 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: + - "4.4.3" +before_install: + - npm install -g gulp diff --git a/gulp/tasks/test.js b/gulp/tasks/test.js new file mode 100644 index 00000000..474db121 --- /dev/null +++ b/gulp/tasks/test.js @@ -0,0 +1,13 @@ +var gulp = require('gulp'); +var Server = require('karma').Server; +var path = require('path'); + +/** + * Run test once and exit + */ +gulp.task('test', function (done) { + new Server({ + configFile: path.resolve(__dirname, '../../karma.conf.js'), + singleRun: true + }, done).start(); +}); diff --git a/package.json b/package.json index 5b523926..16e08e28 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,8 @@ ], "scripts": { "start": "node app.js", - "postinstall": "gulp build --prod" + "postinstall": "gulp build --prod", + "test": "gulp test" }, "keywords": [ "dillinger", @@ -110,7 +111,7 @@ "htmlparser2": "^3.8.3", "jshint-stylish": "^1.0.0", "json-loader": "^0.5.1", - "karma": "0.13.10", + "karma": "0.13.22", "karma-chrome-launcher": "^0.1.5", "karma-jasmine": "^0.1.5", "karma-phantomjs-launcher": "^0.1.4",