saucelabs
Advanced tools
Comparing version 0.1.1 to 1.0.0
@@ -5,3 +5,7 @@ var crypto = require('crypto'); | ||
var utils = require('./utils'); | ||
var HttpsProxyAgent = require('https-proxy-agent'); | ||
var url = require('url'); | ||
var extend = utils.extend; | ||
@@ -13,2 +17,3 @@ var replace = utils.replace; | ||
password: null, | ||
proxy: null, | ||
hostname: 'saucelabs.com', | ||
@@ -90,2 +95,10 @@ base: '/rest/v1/', | ||
SauceLabs.prototype.showJobAssets = function (id, callback) { | ||
this.send({ | ||
method: 'GET', | ||
path: ':username/jobs/:id/assets', | ||
args: { id: id } | ||
}, callback); | ||
}; | ||
SauceLabs.prototype.updateJob = function (id, data, callback) { | ||
@@ -266,5 +279,7 @@ this.send({ | ||
function makeRequest(options, body, callback) { | ||
var request = https.request(options, function (response) { | ||
if(options.proxy){ | ||
options.agent = new HttpsProxyAgent(url.parse(options.proxy)); | ||
} | ||
var request = https.request(options, function (response) { | ||
var result = ''; | ||
response | ||
@@ -271,0 +286,0 @@ .on('data', function (chunk) { |
@@ -5,3 +5,3 @@ { | ||
"description": "A wrapper around Sauce Labs REST API", | ||
"version": "0.1.1", | ||
"version": "1.0.0", | ||
"homepage": "https://github.com/holidayextras/node-saucelabs", | ||
@@ -16,3 +16,5 @@ "repository": { | ||
"chai": "1.5.x", | ||
"nock": "0.17.x" | ||
"nock": "0.17.x", | ||
"https-proxy-agent": "1.0.0", | ||
"url": "0.11.0" | ||
}, | ||
@@ -19,0 +21,0 @@ "engines": { |
@@ -1,2 +0,2 @@ | ||
# node-saucelabs [![Build Status](https://secure.travis-ci.org/holidayextras/node-saucelabs.png)](http://travis-ci.org/holidayextras/node-saucelabs) | ||
# node-saucelabs [![Build Status](https://secure.travis-ci.org/holidayextras/node-saucelabs.png)](http://travis-ci.org/holidayextras/node-saucelabs)[![Build Status](https://www.codeship.io/projects/83c9b290-21de-0131-e459-3688c4e23c72/status)](https://www.codeship.io/projects/83c9b290-21de-0131-e459-3688c4e23c72/status) | ||
@@ -67,3 +67,14 @@ Wrapper around the Sauce Labs REST API for [Node.js](http://nodejs.org/). | ||
``` | ||
## Using a proxy | ||
If you're behind a corporate firewall or would like to utilize a proxy, define it in the constructor like this: | ||
```javascript | ||
var sauce = new SauceLabs({ | ||
username: "your-sauce-username", | ||
password: "your-sauce-api-key", | ||
proxy: "https://your-proxy.com:8000" | ||
}); | ||
``` | ||
## Supported Methods | ||
@@ -70,0 +81,0 @@ |
@@ -18,3 +18,4 @@ describe('SauceLabs', function () { | ||
username: 'johndoe', | ||
password: '550e8400-e29b-41d4-a716-446655440000' | ||
password: '550e8400-e29b-41d4-a716-446655440000', | ||
proxy: 'http://google.com' | ||
}; | ||
@@ -120,2 +121,10 @@ | ||
describe('#showJobAssets', function () { | ||
it('GETs `/rest/v1/:username/jobs/:id/assets`', function (done) { | ||
var id = '01230123-example-id-1234'; | ||
var mock = nockle.get('/rest/v1/:username/jobs/:id/assets', { id: id }); | ||
sauce.showJobAssets(id, verifySuccess(mock, done)); | ||
}); | ||
}); | ||
describe('#updateJob', function () { | ||
@@ -226,3 +235,2 @@ it('PUTs `/rest/v1/:username/jobs/:id`', function (done) { | ||
var date = new Date('Jan 1, 1970 00:00:00'); | ||
describe('with job ID, date and hour', function () { | ||
@@ -229,0 +237,0 @@ it('creates the proper link', function (done) { |
Sorry, the diff of this file is not supported yet
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
30862
604
0
302
6