From e7e7301675b754ed5c43a3e78ce00e43bf94d62a Mon Sep 17 00:00:00 2001 From: Benjamin Albert Date: Fri, 6 May 2016 22:31:59 +0300 Subject: [PATCH 1/2] Makes npm install run gulp build --prod To avoid issues such as #514 and to allow Travis CI to run unit test. --- package.json | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index 527eee0d..5b523926 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ ], "scripts": { "start": "node app.js", - "predeploy": "gulp build --prod" + "postinstall": "gulp build --prod" }, "keywords": [ "dillinger", @@ -73,6 +73,21 @@ "markdown-it-sup": "^1.0.0", "markdown-it-toc": "^1.1.0", "method-override": "^2.3.5", + "gulp": "^3.9.0", + "gulp-autoprefixer": "^3.0.2", + "gulp-combine-media-queries": "^0.2.0", + "gulp-csso": "^0.2.9", + "gulp-filename-media-query": "^1.2.1", + "gulp-group-css-media-queries": "^1.1.0", + "gulp-if": "2.0.0", + "gulp-notify": "^2.2.0", + "gulp-open": "^0.3.0", + "gulp-rev-mtime": "^0.0.4", + "gulp-rimraf": "0.2.0", + "gulp-sass": "^2.0.4", + "gulp-size": "^1.1.0", + "gulp-uncss": "^0.5.1", + "gulp-util": "^3.0.6", "morgan": "^1.6.1", "phantom": "^2.0.4", "rc": "0.3.0", @@ -92,21 +107,6 @@ "dom-serializer": "^0.1.0", "exports-loader": "^0.6.2", "glob": "^5.0.5", - "gulp": "^3.9.0", - "gulp-autoprefixer": "^3.0.2", - "gulp-combine-media-queries": "^0.2.0", - "gulp-csso": "^0.2.9", - "gulp-filename-media-query": "^1.2.1", - "gulp-group-css-media-queries": "^1.1.0", - "gulp-if": "2.0.0", - "gulp-notify": "^2.2.0", - "gulp-open": "^0.3.0", - "gulp-rev-mtime": "^0.0.4", - "gulp-rimraf": "0.2.0", - "gulp-sass": "^2.0.4", - "gulp-size": "^1.1.0", - "gulp-uncss": "^0.5.1", - "gulp-util": "^3.0.6", "htmlparser2": "^3.8.3", "jshint-stylish": "^1.0.0", "json-loader": "^0.5.1", From c787319d0a0a10cd5044ba70fbd8f70f16a9ff50 Mon Sep 17 00:00:00 2001 From: Benjamin Albert Date: Fri, 6 May 2016 22:36:39 +0300 Subject: [PATCH 2/2] Adds .travis.yml and gulp test task This commit also updates karam to 0.13.22 to avoid karma-runner/karma#1782 (sockets.forEach is not a function) when running gulp test. --- .travis.yml | 5 +++++ gulp/tasks/test.js | 13 +++++++++++++ package.json | 5 +++-- 3 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 .travis.yml create mode 100644 gulp/tasks/test.js diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..580cc7f6 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: + - "5.10.1" +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",