Socket
Socket
Sign inDemoInstall

karma-sauce-launcher

Package Overview
Dependencies
Maintainers
3
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

karma-sauce-launcher - npm Package Compare versions

Comparing version 4.1.3 to 4.1.4

7

CHANGELOG.md

@@ -0,1 +1,8 @@

## [4.1.4](https://github.com/karma-runner/karma-sauce-launcher/compare/v4.1.3...v4.1.4) (2020-04-28)
### Bug Fixes
* remove heartbeat function ([#205](https://github.com/karma-runner/karma-sauce-launcher/issues/205)) ([10e93cc](https://github.com/karma-runner/karma-sauce-launcher/commit/10e93cc5f9787c275db8c72f159dea65690b77f1))
## [4.1.3](https://github.com/karma-runner/karma-sauce-launcher/compare/v4.1.2...v4.1.3) (2020-04-13)

@@ -2,0 +9,0 @@

31

dist/launcher/launcher.js

@@ -24,28 +24,7 @@ "use strict";

let connectedDrivers = [];
// number of pending cancellations for heartbeat functionality
let pendingCancellations = 0;
// Setup Browser name that will be printed out by Karma.
this.name = browserName + ' on SauceLabs';
let pendingHeartBeat;
const formatSauceError = (err) => {
return err.message + '\n' + (err.data ? ' ' + err.data : '');
};
// Heartbeat function to keep alive sessions on Sauce Labs via webdriver JSON wire calls
const heartbeat = () => {
pendingHeartBeat = setTimeout((driver) => {
log.debug('Heartbeat to Sauce Labs (%s) - fetching title', browserName);
if (driver === undefined) {
log.error('Heartbeat to %s failed: driver is null\n %s', browserName);
clearTimeout(pendingHeartBeat);
return this._done('failure');
}
driver.getTitle()
.then(null, (err) => {
log.error('Heartbeat to %s failed\n %s', browserName, formatSauceError(err));
clearTimeout(pendingHeartBeat);
return this._done('failure');
});
heartbeat();
}, 60000);
};
// Listen for the start event from Karma. I know, the API is a bit different to how you

@@ -85,10 +64,4 @@ // would expect, but we need to follow this approach unless we want to spend more work

yield driver.get(pageUrl);
heartbeat();
}
catch (e) {
// determine if there are still pending cancellations based on the heartbeat
if (pendingCancellations > 0) {
pendingCancellations--;
return;
}
log.error(e);

@@ -100,6 +73,2 @@ // Notify karma about the failure.

this.on('kill', (doneFn) => __awaiter(this, void 0, void 0, function* () {
// If there is still pending heartbeats, clear the timeout
if (pendingHeartBeat) {
clearTimeout(pendingHeartBeat);
}
try {

@@ -106,0 +75,0 @@ yield Promise.all(connectedDrivers.map(driver => driver.quit()));

2

package.json
{
"name": "karma-sauce-launcher",
"version": "4.1.3",
"version": "4.1.4",
"description": "A Karma plugin. Launch any browser on SauceLabs!",

@@ -5,0 +5,0 @@ "main": "./dist/index.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc