From c45300e06ccedbbbb387cf52bb357c2d889f2a06 Mon Sep 17 00:00:00 2001 From: Yury Delendik Date: Mon, 9 Jan 2017 15:43:45 -0600 Subject: [PATCH] Enables some unit tests on travis. --- gulpfile.js | 13 +++++++++++++ package.json | 5 +++-- test/unit/clitests.json | 18 ++++++++++++++++++ 3 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 test/unit/clitests.json diff --git a/gulpfile.js b/gulpfile.js index 21367d763..b5c71df62 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -525,6 +525,19 @@ gulp.task('botmakeref', function (done) { }); }); +gulp.task('unittestcli', function (done) { + var args = ['JASMINE_CONFIG_PATH=test/unit/clitests.json']; + var testProcess = spawn('node_modules/.bin/jasmine', args, + {stdio: 'inherit'}); + testProcess.on('close', function (code) { + if (code !== 0) { + done(new Error('Unit tests failed.')); + return; + } + done(); + }); +}); + gulp.task('lint', function (done) { console.log(); console.log('### Linting JS files'); diff --git a/package.json b/package.json index 35042a058..c39f07c8e 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,8 @@ "gulp": "^3.9.1", "gulp-util": "^3.0.7", "gulp-zip": "^3.2.0", - "jasmine-core": "^2.4.1", + "jasmine": "^2.5.2", + "jasmine-core": "^2.5.2", "jsdoc": "^3.3.0-alpha9", "mkdirp": "^0.5.1", "node-ensure": "^0.0.0", @@ -23,7 +24,7 @@ "yargs": "^3.14.0" }, "scripts": { - "test": "gulp lint" + "test": "gulp lint unittestcli" }, "repository": { "type": "git", diff --git a/test/unit/clitests.json b/test/unit/clitests.json new file mode 100644 index 000000000..fbf81d93c --- /dev/null +++ b/test/unit/clitests.json @@ -0,0 +1,18 @@ +{ + "spec_dir": "test/unit", + "spec_files": [ + "cff_parser_spec.js", + "crypto_spec.js", + "dom_utils_spec.js", + "evaluator_spec.js", + "fonts_spec.js", + "function_spec.js", + "murmurhash3_spec.js", + "parser_spec.js", + "primitives_spec.js", + "stream_spec.js", + "type1_parser_spec.js", + "unicode_spec.js", + "util_spec.js" + ] +}