Socket
Socket
Sign inDemoInstall

saucelabs

Package Overview
Dependencies
Maintainers
2
Versions
122
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

saucelabs - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

40

lib/SauceLabs.js

@@ -262,3 +262,3 @@ var crypto = require('crypto');

'Content-Type': 'application/json',
'Content-Length': body != null ? body.length : 0
'Content-Length': body != null ? Buffer.byteLength(body) : 0
}

@@ -297,22 +297,24 @@ });

var result = '';
response
.on('data', function (chunk) {
result += chunk;
})
.on('end', function () {
var res;
if (callback) {
response
.on('data', function (chunk) {
result += chunk;
})
.on('end', function () {
var res;
try {
res = JSON.parse(result);
} catch (e) {
callback('Could not parse response: ' + result);
return;
}
try {
res = JSON.parse(result);
} catch (e) {
callback('Could not parse response: ' + result);
return;
}
if (response.statusCode === 200) {
callback(null, res);
} else {
callback(res);
}
});
if (response.statusCode === 200) {
callback(null, res);
} else {
callback(res);
}
});
}
});

@@ -319,0 +321,0 @@

@@ -5,3 +5,3 @@ {

"description": "A wrapper around Sauce Labs REST API",
"version": "1.2.0",
"version": "1.3.0",
"homepage": "https://github.com/holidayextras/node-saucelabs",

@@ -8,0 +8,0 @@ "repository": {

@@ -141,2 +141,9 @@ describe('SauceLabs', function () {

});
it('doesnt require a callback', function (done) {
var id = '01230123-example-id-1234';
var mock = nockle.put('/rest/v1/:username/jobs/:id', { id: id });
sauce.updateJob(id, {});
done();
});
});

@@ -143,0 +150,0 @@

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