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){
181181gulp . task ( 'run-browser-test-chrome' , function ( cb ) {
182182 new karmaServer ( {
183183 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 ( ) ;
185188} ) ;
186189
187190gulp . task ( 'run-browser-test-firefox' , function ( cb ) {
188191 new karmaServer ( {
189192 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 ( ) ;
191197} ) ;
192198
193199gulp . task ( 'run-browser-test-edge' , function ( cb ) {
194200 new karmaServer ( {
195201 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 ( ) ;
197206} ) ;
198207
199208gulp . task ( 'run-browser-test-ie' , function ( cb ) {
200209 new karmaServer ( {
201210 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 ( ) ;
203215} ) ;
204216
205217gulp . task ( 'watch' , function ( ) {
Original file line number Diff line number Diff line change @@ -30,6 +30,8 @@ describe('http driver', () => {
3030 let serverVersion ;
3131
3232 beforeEach ( async ( ) => {
33+ jasmine . addMatchers ( testUtils . matchers ) ;
34+
3335 originalTimeout = jasmine . DEFAULT_TIMEOUT_INTERVAL ;
3436 jasmine . DEFAULT_TIMEOUT_INTERVAL = 20000 ;
3537
@@ -253,7 +255,7 @@ describe('http driver', () => {
253255 } catch ( error ) {
254256 failed = true ;
255257 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' ] ) ;
257259 expect ( error . message . indexOf ( 'transaction has been terminated' ) ) . not . toBeLessThan ( 0 ) ;
258260 }
259261
Original file line number Diff line number Diff line change @@ -30,8 +30,31 @@ function fakeStandardDateWithOffset(offsetMinutes) {
3030 return date ;
3131}
3232
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+
3355export default {
3456 isClient,
3557 isServer,
36- fakeStandardDateWithOffset
58+ fakeStandardDateWithOffset,
59+ matchers
3760} ;
You can’t perform that action at this time.
0 commit comments