CircleCI test failed but build successfully problem fixed (#2816)

This commit is contained in:
黄家辉
2018-06-07 17:33:54 +08:00
committed by Jare Guo
parent 9dbf1cd1ab
commit 02391c6cf2
3 changed files with 17 additions and 5 deletions
+1 -4
View File
@@ -10,10 +10,7 @@ jobs:
- run: sudo npm install -g gulp
- run: npm install gulp-qunit
- run: npm install
- run:
command:
set -e
npm test
- run: npm test
workflows:
version: 2
+15
View File
@@ -167,3 +167,18 @@ gulp.task('watch-jsb-polyfill', function () {
});
gulp.task('watch-dev-files', ['watch-preview', 'watch-jsb-polyfill']);
gulp.task('test-in-ci', function () {
const { spawn } = require('child_process');
var gulp = process.platform === 'win32' ? 'gulp.cmd' : 'gulp';
var child = spawn(gulp, ['test'], {
stdio: [0, 'pipe', 2]
});
child.stdout.on('data', function (data) {
process.stdout.write(data);
if (data.toString().indexOf(' assertions failed ') !== -1) {
process.exitCode = 1;
process.exit();
}
});
});
+1 -1
View File
@@ -8,7 +8,7 @@
],
"license": "MIT",
"scripts": {
"test": "gulp test"
"test": "gulp test-in-ci"
},
"devDependencies": {
"async": "1.5.2",