File tree Expand file tree Collapse file tree 3 files changed +43
-6
lines changed Expand file tree Collapse file tree 3 files changed +43
-6
lines changed Original file line number Diff line number Diff line change @@ -181,25 +181,37 @@ gulp.task('run-browser-test', function(cb){
181
181
gulp . task ( 'run-browser-test-chrome' , function ( cb ) {
182
182
new karmaServer ( {
183
183
configFile : __dirname + '/test/browser/karma-chrome.conf.js' ,
184
- } , cb ) . start ( ) ;
184
+ singleRun : true ,
185
+ } , function ( exitCode ) {
186
+ exitCode ? process . exit ( exitCode ) : cb ( ) ;
187
+ } ) . start ( ) ;
185
188
} ) ;
186
189
187
190
gulp . task ( 'run-browser-test-firefox' , function ( cb ) {
188
191
new karmaServer ( {
189
192
configFile : __dirname + '/test/browser/karma-firefox.conf.js' ,
190
- } , cb ) . start ( ) ;
193
+ singleRun : true ,
194
+ } , function ( exitCode ) {
195
+ exitCode ? process . exit ( exitCode ) : cb ( ) ;
196
+ } ) . start ( ) ;
191
197
} ) ;
192
198
193
199
gulp . task ( 'run-browser-test-edge' , function ( cb ) {
194
200
new karmaServer ( {
195
201
configFile : __dirname + '/test/browser/karma-edge.conf.js' ,
196
- } , cb ) . start ( ) ;
202
+ singleRun : true ,
203
+ } , function ( exitCode ) {
204
+ exitCode ? process . exit ( exitCode ) : cb ( ) ;
205
+ } ) . start ( ) ;
197
206
} ) ;
198
207
199
208
gulp . task ( 'run-browser-test-ie' , function ( cb ) {
200
209
new karmaServer ( {
201
210
configFile : __dirname + '/test/browser/karma-ie.conf.js' ,
202
- } , cb ) . start ( ) ;
211
+ singleRun : true ,
212
+ } , function ( exitCode ) {
213
+ exitCode ? process . exit ( exitCode ) : cb ( ) ;
214
+ } ) . start ( ) ;
203
215
} ) ;
204
216
205
217
gulp . task ( 'watch' , function ( ) {
Original file line number Diff line number Diff line change @@ -30,6 +30,8 @@ describe('http driver', () => {
30
30
let serverVersion ;
31
31
32
32
beforeEach ( async ( ) => {
33
+ jasmine . addMatchers ( testUtils . matchers ) ;
34
+
33
35
originalTimeout = jasmine . DEFAULT_TIMEOUT_INTERVAL ;
34
36
jasmine . DEFAULT_TIMEOUT_INTERVAL = 20000 ;
35
37
@@ -253,7 +255,7 @@ describe('http driver', () => {
253
255
} catch ( error ) {
254
256
failed = true ;
255
257
expect ( error . name ) . toEqual ( 'Neo4jError' ) ;
256
- expect ( error . code ) . toEqual ( 'Neo.DatabaseError.Statement.ExecutionFailed' ) ;
258
+ expect ( error . code ) . toBeElementOf ( [ 'Neo.DatabaseError.Statement.ExecutionFailed' , 'Neo.TransientError.Transaction.LockClientStopped' ] ) ;
257
259
expect ( error . message . indexOf ( 'transaction has been terminated' ) ) . not . toBeLessThan ( 0 ) ;
258
260
}
259
261
Original file line number Diff line number Diff line change @@ -30,8 +30,31 @@ function fakeStandardDateWithOffset(offsetMinutes) {
30
30
return date ;
31
31
}
32
32
33
+ const matchers = {
34
+ toBeElementOf : function ( util , customEqualityTesters ) {
35
+ return {
36
+ compare : function ( actual , expected ) {
37
+ if ( expected === undefined ) {
38
+ expected = [ ] ;
39
+ }
40
+
41
+ let result = { } ;
42
+
43
+ result . pass = util . contains ( expected , actual ) ;
44
+ if ( result . pass ) {
45
+ result . message = `Expected '${ actual } ' to be an element of '[${ expected } ]'` ;
46
+ } else {
47
+ result . message = `Expected '${ actual } ' to be an element of '[${ expected } ]', but it wasn't` ;
48
+ }
49
+ return result ;
50
+ }
51
+ }
52
+ }
53
+ } ;
54
+
33
55
export default {
34
56
isClient,
35
57
isServer,
36
- fakeStandardDateWithOffset
58
+ fakeStandardDateWithOffset,
59
+ matchers
37
60
} ;
You can’t perform that action at this time.
0 commit comments