File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -28,16 +28,25 @@ export function SaucelabsReporter(logger, browserMap: BrowserMap) {
28
28
// This fires when a single test is executed and will update the run in sauce labs with an annotation
29
29
// of the test including the status of the test
30
30
this . onSpecComplete = function ( browser , result ) {
31
+ const browserId = browser . id ;
32
+ const browserData = browserMap . get ( browserId ) ;
33
+
34
+ // Do nothing if the current browser has not been launched through the Saucelabs
35
+ // launcher.
36
+ if ( ! browserData ) {
37
+ return ;
38
+ }
39
+
31
40
const status = result . success ? '✅' : '❌'
32
41
33
- browserMap . get ( browser . id ) . results . push ( {
42
+ browserData . results . push ( {
34
43
status : 'info' ,
35
44
message : `${ status } ${ result . fullName } ` ,
36
45
screenshot : null
37
46
} )
38
47
39
48
if ( ! result . success && result . log . length > 0 ) {
40
- browserMap . get ( browser . id ) . results . push ( {
49
+ browserData . results . push ( {
41
50
status : 'info' ,
42
51
message : `${ result . log [ 0 ] } ` ,
43
52
screenshot : null
You can’t perform that action at this time.
0 commit comments