Skip to content

Commit 6cb5995

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 9cf957f + b119018 commit 6cb5995

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
## [4.3.4](https://github.com/karma-runner/karma-sauce-launcher/compare/v4.3.3...v4.3.4) (2020-11-30)
2+
3+
4+
### Bug Fixes
5+
6+
* fix reporter with browsers not launched through launcher ([39943d7](https://github.com/karma-runner/karma-sauce-launcher/commit/39943d752ea600469de1c5d388834cb4cb386d2f)), closes [#232](https://github.com/karma-runner/karma-sauce-launcher/issues/232)
7+
8+
## [4.3.3](https://github.com/karma-runner/karma-sauce-launcher/compare/v4.3.2...v4.3.3) (2020-10-30)
9+
10+
11+
### Bug Fixes
12+
13+
* update (dev)dependencies ([c86ffe7](https://github.com/karma-runner/karma-sauce-launcher/commit/c86ffe7a1b7d04c0bcdea5e67b52fa81087b084d))
14+
* update sending custom information to Sauce Labs ([6090ea8](https://github.com/karma-runner/karma-sauce-launcher/commit/6090ea872f3b0f3fcfdb585d8be46835c0ba6fb5))
15+
116
## [4.3.2](https://github.com/karma-runner/karma-sauce-launcher/compare/v4.3.1...v4.3.2) (2020-10-30)
217

318

src/reporter/reporter.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,25 @@ export function SaucelabsReporter(logger, browserMap: BrowserMap) {
2828
// This fires when a single test is executed and will update the run in sauce labs with an annotation
2929
// of the test including the status of the test
3030
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+
3140
const status = result.success ? '✅' : '❌'
3241

33-
browserMap.get(browser.id).results.push({
42+
browserData.results.push({
3443
status: 'info',
3544
message: `${status} ${result.fullName}`,
3645
screenshot: null
3746
})
3847

3948
if (!result.success && result.log.length > 0) {
40-
browserMap.get(browser.id).results.push({
49+
browserData.results.push({
4150
status: 'info',
4251
message: `${result.log[0]}`,
4352
screenshot: null

0 commit comments

Comments
 (0)