This repository was archived by the owner on Jul 29, 2024. It is now read-only.
File tree 2 files changed +18
-5
lines changed
2 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -84,22 +84,28 @@ var addConfig = function(additionalConfig) {
84
84
var cleanUp = function ( runner ) {
85
85
var passed = runner . results ( ) . failedCount == 0 ;
86
86
var exitCode = passed ? 0 : 1 ;
87
+ var exit = function ( exitCode ) {
88
+ if ( typeof config . onCleanUp === 'function' ) {
89
+ config . onCleanUp ( exitCode ) ;
90
+ }
91
+ process . exit ( exitCode ) ;
92
+ } ;
87
93
if ( sauceAccount ) {
88
94
sauceAccount . updateJob ( sessionId , { 'passed' : passed } , function ( err ) {
89
95
if ( err ) {
90
96
throw new Error (
91
97
"Error updating Sauce pass/fail status: " + util . inspect ( err )
92
98
) ;
93
99
}
94
- process . exit ( exitCode ) ;
100
+ exit ( exitCode ) ;
95
101
} ) ;
96
102
} else if ( server ) {
97
103
util . puts ( 'Shutting down selenium standalone server.' ) ;
98
104
server . stop ( ) . then ( function ( ) {
99
- process . exit ( exitCode ) ;
105
+ exit ( exitCode ) ;
100
106
} ) ;
101
107
} else {
102
- process . exit ( exitCode ) ;
108
+ exit ( exitCode ) ;
103
109
}
104
110
} ;
105
111
Original file line number Diff line number Diff line change @@ -120,13 +120,20 @@ exports.config = {
120
120
includeStackTrace : true ,
121
121
// Default time to wait in ms before a test fails.
122
122
defaultTimeoutInterval : 30000
123
- }
123
+ } ,
124
124
125
125
// ----- Options to be passed to mocha -----
126
126
//
127
127
// See the full list at http://visionmedia.github.io/mocha/
128
128
mochaOpts : {
129
129
ui : 'bdd' ,
130
130
reporter : 'list'
131
- }
131
+ } ,
132
+
133
+ // ----- The cleanup step -----
134
+ //
135
+ // A callback function called once the tests have finished running and
136
+ // the webdriver instance has been shut down. It is passed the exit code
137
+ // (0 if the tests passed or 1 if not).
138
+ onCleanUp : function ( ) { }
132
139
} ;
You can’t perform that action at this time.
0 commit comments