Skip to content

Commit 71fcd1a

Browse files
committed
Run build and test in series to prevent race condition
1 parent 9f2c53b commit 71fcd1a

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

gulpfile.js

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@ var babel = require('gulp-babel');
1919
var watch = require('gulp-watch');
2020
var batch = require('gulp-batch');
2121
var fs = require("fs");
22+
var runSequence = require('run-sequence');
2223

2324
gulp.task('default', ["test"]);
2425

2526
/** Build all-in-one files for use in the browser */
26-
gulp.task('browser', ['nodejs'], function () {
27+
gulp.task('browser', function () {
2728

2829
var browserOutput = 'build/browser';
2930
var testFiles = [];
@@ -94,9 +95,13 @@ gulp.task('nodejs', function(){
9495
});
9596
})
9697

97-
gulp.task('all', ['nodejs', 'browser']);
98+
gulp.task('all', function(cb){
99+
runSequence('nodejs', 'browser', cb);
100+
});
98101

99-
gulp.task('test', ['test-nodejs', 'test-browser']);
102+
gulp.task('test', function(cb){
103+
runSequence('test-nodejs', 'test-browser', cb);
104+
});
100105

101106
gulp.task('start-neo4j', ['download-neo4j'], shell.task([
102107
'chmod +x build/neo4j-enterprise*/bin/neo4j',
@@ -118,10 +123,14 @@ gulp.task('test-nodejs', ['nodejs'], function () {
118123
}));
119124
});
120125

121-
gulp.task('test-browser', ['browser'], function () {
126+
gulp.task('test-browser', function (cb) {
127+
runSequence('all', 'run-browser-test', cb)
128+
});
129+
130+
gulp.task('run-browser-test', function(){
122131
return gulp.src('build/browser/neo4j-web.test.js')
123132
.pipe(jasmineBrowser.specRunner({console: true}))
124-
.pipe(jasmineBrowser.headless({driver: 'slimerjs'}));
133+
.pipe(jasmineBrowser.headless({driver: 'slimerjs'}))
125134
});
126135

127136
gulp.task('watch', function () {

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"gulp-util": "^3.0.6",
4040
"gulp-watch": "^4.3.5",
4141
"jasmine-reporters": "^2.0.7",
42+
"run-sequence": "^1.1.4",
4243
"slimerjs": "^0.9.6",
4344
"through2": "~2.0.0",
4445
"vinyl-buffer": "^1.0.0",

0 commit comments

Comments
 (0)