mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 16:12:40 +08:00
CircleCI test failed but build successfully problem fixed (#2816)
This commit is contained in:
@@ -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
@@ -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
@@ -8,7 +8,7 @@
|
||||
],
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"test": "gulp test"
|
||||
"test": "gulp test-in-ci"
|
||||
},
|
||||
"devDependencies": {
|
||||
"async": "1.5.2",
|
||||
|
||||
Reference in New Issue
Block a user