Socket
Socket
Sign inDemoInstall

saucelabs

Package Overview
Dependencies
123
Maintainers
3
Versions
121
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 7.2.2 to 7.2.3

.github/dependabot.yml

24

build/cli.js

@@ -7,16 +7,9 @@ "use strict";

exports.run = void 0;
var _yargs = _interopRequireDefault(require("yargs"));
var _constants = require("./constants");
var _utils = require("./utils");
var _ = _interopRequireDefault(require("./"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const run = () => {
let argv = _yargs.default.usage(_constants.USAGE).epilog(_constants.EPILOG).demandCommand().commandDir('commands').help().version(_constants.SAUCE_VERSION_NOTE);
for (const [commandName, options] of _constants.PROTOCOL_MAP) {

@@ -26,3 +19,2 @@ const params = (0, _utils.getParameters)(options.description.parameters);

const description = options.description.summary || options.description.description || 'Unknown description';
_yargs.default.command(command.trim(), description, yargs => {

@@ -34,7 +26,5 @@ for (const param of params) {

};
if (typeof param.default !== 'undefined') {
paramDescription.default = param.default;
}
yargs.positional(param.name, paramDescription);

@@ -60,12 +50,10 @@ }

const requiredParams = params.filter(p => p.required).map(p => argv[p.name]);
try {
const result = await api[commandName](...requiredParams, argv);
if (typeof result === 'object') {
// eslint-disable-next-line no-console
return console.log(JSON.stringify(result, null, 4));
} // eslint-disable-next-line no-console
}
// eslint-disable-next-line no-console
console.log(result);

@@ -77,7 +65,6 @@ } catch (error) {

}
/**
* only return for testing purposes
*/
if (process.env.JEST_WORKER_ID) {

@@ -88,14 +75,11 @@ return api;

}
/**
* populate cli arguments
*/
for (const param of _constants.CLI_PARAMS) {
argv = argv.option(param.name, param);
}
return argv.argv;
};
exports.run = run;

@@ -7,9 +7,5 @@ "use strict";

exports.handler = exports.describe = exports.command = exports.builder = void 0;
var _ = _interopRequireDefault(require("./.."));
var _constants = require("../constants");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const command = 'sc [flags]';

@@ -19,3 +15,2 @@ exports.command = command;

exports.describe = describe;
const builder = yargs => {

@@ -26,5 +21,3 @@ for (const option of _constants.SAUCE_CONNECT_CLI_PARAMS) {

};
exports.builder = builder;
const handler = async argv => {

@@ -47,3 +40,2 @@ const {

};
exports.handler = handler;

@@ -7,11 +7,6 @@ "use strict";

exports.USAGE = exports.TO_STRING_TAG = exports.SYMBOL_TOSTRING = exports.SYMBOL_ITERATOR = exports.SYMBOL_INSPECT = exports.SC_WAIT_FOR_MESSAGES = exports.SC_READY_MESSAGE = exports.SC_PARAMS_TO_STRIP = exports.SC_FAILURE_MESSAGES = exports.SC_CLOSE_TIMEOUT = exports.SC_CLOSE_MESSAGE = exports.SC_CLI_PARAM_KEYS = exports.SC_BOOLEAN_CLI_PARAMS = exports.SAUCE_VERSION_NOTE = exports.SAUCE_CONNECT_VERSIONS_ENDPOINT = exports.SAUCE_CONNECT_PLATFORM_DATA = exports.SAUCE_CONNECT_CLI_PARAMS = exports.SAUCE_CONNECT_BASE = exports.PROTOCOL_MAP = exports.PARAMETERS_MAP = exports.JOB_ASSET_NAMES = exports.EPILOG = exports.DEFAULT_SAUCE_CONNECT_VERSION = exports.DEFAULT_OPTIONS = exports.CLI_PARAMS = exports.ASSET_REGION_MAPPING = void 0;
var _changeCase = require("change-case");
var _os = _interopRequireDefault(require("os"));
var _package = require("../package.json");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const DEFAULT_SAUCE_CONNECT_VERSION = '4.9.0';

@@ -43,3 +38,2 @@ exports.DEFAULT_SAUCE_CONNECT_VERSION = DEFAULT_SAUCE_CONNECT_VERSION;

const parametersFlattened = new Map();
for (const {

@@ -54,3 +48,2 @@ paths,

}
for (const [endpoint, methods] of Object.entries(paths)) {

@@ -62,17 +55,13 @@ for (const [method, description] of Object.entries(methods)) {

*/
if (description.deprecated) {
commandName += 'Deprecated';
}
/**
* ensure we don't double register commands
*/
/* istanbul ignore if */
if (protocolFlattened.has(commandName)) {
throw new Error(`command ${commandName} already registered`);
}
protocolFlattened.set(commandName, {

@@ -88,3 +77,2 @@ method,

}
const PROTOCOL_MAP = protocolFlattened;

@@ -337,3 +325,2 @@ exports.PROTOCOL_MAP = PROTOCOL_MAP;

const SC_WAIT_FOR_MESSAGES = ['\u001b[K', 'Please wait for']; // "\u001b" = Escape character
exports.SC_WAIT_FOR_MESSAGES = SC_WAIT_FOR_MESSAGES;

@@ -340,0 +327,0 @@ const SC_CLOSE_MESSAGE = 'Goodbye';

@@ -7,25 +7,15 @@ "use strict";

exports.default = void 0;
var _fs = _interopRequireDefault(require("fs"));
var _path = _interopRequireDefault(require("path"));
var _child_process = require("child_process");
var _got = _interopRequireDefault(require("got"));
var _formData = _interopRequireDefault(require("form-data"));
var _changeCase = require("change-case");
var _queryString = require("query-string");
var _queryString = _interopRequireDefault(require("query-string"));
var _utils = require("./utils");
var _constants = require("./constants");
var _sauceConnectLoader = _interopRequireDefault(require("./sauceConnectLoader"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// https://github.com/import-js/eslint-plugin-import/issues/2352
// eslint-disable-next-line import/no-unresolved
class SauceLabs {

@@ -43,7 +33,7 @@ constructor(options) {

followRedirect: true,
headers: { ...this._options.headers,
headers: {
...this._options.headers,
Authorization: `Basic ${Buffer.from(`${this.username}:${this._accessKey}`).toString('base64')}`
}
});
if (typeof this._options.proxy === 'string') {

@@ -55,7 +45,6 @@ var proxyAgent = (0, _utils.createProxyAgent)(this._options.proxy);

}
/**
* public fields
*/
this.region = this._options.region;

@@ -77,3 +66,2 @@ this.tld = this._options.tld;

}
get(_, propName) {

@@ -84,3 +72,2 @@ /**

*/
/* istanbul ignore next */

@@ -90,2 +77,3 @@ if (propName === _constants.SYMBOL_INSPECT || propName === 'inspect') {

}
/**

@@ -95,7 +83,6 @@ * print to string tag

*/
if (propName === _constants.SYMBOL_TOSTRING) {
return _constants.TO_STRING_TAG;
}
/**

@@ -105,48 +92,38 @@ * return instance iterator

*/
if (propName === _constants.SYMBOL_ITERATOR) {
return;
}
/**
* provide access to Sauce Connect interface
*/
if (propName === 'startSauceConnect') {
return this._startSauceConnect.bind(this);
}
/**
* have special implementations for certain operations
*/
if (propName === 'uploadJobAssets') {
return this._uploadJobAssets.bind(this);
}
if (propName === 'listBuilds') {
return this._listBuilds.bind(this);
}
if (propName === 'listBuildFailedJobs') {
return this._listBuildFailedJobs.bind(this);
}
if (propName === 'listBuildJobs') {
return this._listBuildJobs.bind(this);
}
if (propName === 'getUserByUsername') {
return this._getUserByUsername.bind(this);
}
/**
* allow to return publicly registered class properties
*/
if (this[propName]) {
return !propName.startsWith('_') ? this[propName] : undefined;
}
if (!_constants.PROTOCOL_MAP.has(propName)) {

@@ -156,3 +133,2 @@ /**

*/
/* istanbul ignore next */

@@ -162,17 +138,13 @@ if (typeof propName !== 'string') {

}
throw new Error(`Couldn't find API endpoint for command "${propName}"`);
}
/**
* handle special commands not defined in the protocol
*/
if (propName === 'downloadJobAsset') {
return this._downloadJobAsset.bind(this);
}
return this._callAPI.bind(this, propName);
}
async _listBuilds(username, args) {

@@ -193,3 +165,2 @@ const {

}
async _listBuildFailedJobs(username, buildId, args) {

@@ -220,3 +191,2 @@ const {

}
async _listBuildJobs(buildId, args) {

@@ -231,3 +201,4 @@ const {

jobs
} = await this._callAPI('getJobsV1_1', { ...args,
} = await this._callAPI('getJobsV1_1', {
...args,
id: jobIds,

@@ -238,3 +209,2 @@ full: true

}
async _getUserByUsername({

@@ -254,3 +224,2 @@ username

}
async _startSauceConnect(argv, fromCLI) {

@@ -262,40 +231,30 @@ if (!fromCLI) {

}
argv[k.split(/(?=[A-Z])/).join('-').toLowerCase()] = v;
}
}
let sauceConnectVersion = argv.scVersion;
if (!sauceConnectVersion) {
sauceConnectVersion = await this._getLatestSauceConnectVersion();
}
const args = Object.entries(argv)
/**
* filter out yargs, yargs params and custom parameters
*/
.filter(([k]) => !['_', '$0', 'sc-version', 'logger', ..._constants.SC_PARAMS_TO_STRIP].includes(k))
*/.filter(([k]) => !['_', '$0', 'sc-version', 'logger', ..._constants.SC_PARAMS_TO_STRIP].includes(k))
/**
* remove duplicate params by yargs
*/
.filter(([k]) => !k.match(/[A-Z]/g))
*/.filter(([k]) => !k.match(/[A-Z]/g))
/**
* replace tunnel-identifier for tunnel-name
*/
.map(([k, v]) => [k === 'tunnel-identifier' ? 'tunnel-name' : k, v])
*/.map(([k, v]) => [k === 'tunnel-identifier' ? 'tunnel-name' : k, v])
/**
* SC uses `--no-XXX` params which gets parsed out by yargs
* therefor we need to re-add it here
*/
.map(([k, v]) => [typeof v === 'boolean' && !v ? `no-${k}` : k, v])
*/.map(([k, v]) => [typeof v === 'boolean' && !v ? `no-${k}` : k, v])
/**
* SC doesn't like boolean values, so we need to make sure to
* no pass it along when we deal with a boolean param
*/
.map(([k, v]) => _constants.SC_BOOLEAN_CLI_PARAMS.includes(k) ? `--${k}` : `--${k}=${v}`);
*/.map(([k, v]) => _constants.SC_BOOLEAN_CLI_PARAMS.includes(k) ? `--${k}` : `--${k}=${v}`);
args.push(`--user=${this.username}`);
args.push(`--api-key=${this._accessKey}`);
const region = argv.region || this.region;
if (region) {

@@ -307,3 +266,2 @@ const scRegion = (0, _utils.getRegionSubDomain)({

}
const scLoader = new _sauceConnectLoader.default({

@@ -320,3 +278,2 @@ sauceConnectVersion

const output = data.toString();
if (output.includes(_constants.SC_CLOSE_MESSAGE)) {

@@ -328,3 +285,2 @@ clearTimeout(timeout);

});
const returnObj = {

@@ -336,2 +292,3 @@ cp,

const output = data.toString();
/**

@@ -341,7 +298,5 @@ * check if error output is just an escape sequence or

*/
if (_constants.SC_WAIT_FOR_MESSAGES.find(msg => escape(output).includes(escape(msg)))) {
return;
}
return reject(new Error(output));

@@ -355,19 +310,16 @@ });

*/
if (typeof logger === 'function') {
logger(output);
}
/**
* fail if SauceConnect could not establish a connection
*/
if (_constants.SC_FAILURE_MESSAGES.find(msg => escape(output).includes(escape(msg)))) {
return reject(new Error(output));
}
/**
* continue if connection was established
*/
if (output.includes(_constants.SC_READY_MESSAGE)) {

@@ -381,3 +333,2 @@ return resolve(returnObj);

}
async _getLatestSauceConnectVersion() {

@@ -397,3 +348,2 @@ try {

}
async _downloadJobAsset(jobId, assetName, {

@@ -408,3 +358,2 @@ filepath

}
const hmac = await (0, _utils.createHMAC)(this.username, this._accessKey, jobId);

@@ -414,3 +363,2 @@ const host = (0, _utils.getAssetHost)(this._options);

const uri = `${host}/jobs/${jobId}/${assetName}?ts=${Date.now()}&auth=${hmac}`;
try {

@@ -420,25 +368,20 @@ const res = await this._api.get(uri, {

});
/**
* parse asset as json if proper content type is given
*/
if (res.headers['content-type'] === 'application/json' && typeof res.body === 'string') {
res.body = JSON.parse(res.body);
}
/**
* only pipe asset to file if path is given
*/
if (typeof filepath === 'string') {
let data = res.body;
const downloadPath = _path.default.resolve(process.cwd(), filepath);
const encoding = res.headers['content-type'] === 'application/json' ? 'utf8' : 'binary';
if (res.headers['content-type'] === 'application/json') {
data = JSON.stringify(res.body, null, 4);
}
_fs.default.writeFileSync(downloadPath, data, {

@@ -448,3 +391,2 @@ encoding

}
return res.body;

@@ -455,3 +397,2 @@ } catch (err) {

}
async _uploadJobAssets(jobId, {

@@ -463,3 +404,2 @@ files = []

}
const {

@@ -471,12 +411,8 @@ servers,

} = _constants.PROTOCOL_MAP.get('uploadJobAssets');
const uri = (0, _utils.getAPIHost)(servers, basePath, this._options) + endpoint.replace('{jobId}', jobId);
const body = new _formData.default();
for (const file of files) {
if (typeof file === 'string') {
const filename = file.startsWith('/') ? file : _path.default.join(process.cwd(), file);
const readStream = _fs.default.createReadStream(filename);
const stats = await _fs.default.promises.stat(filename);

@@ -497,3 +433,2 @@ body.append('file[]', readStream, {

}
try {

@@ -504,10 +439,9 @@ const res = await this._api(uri, {

});
/**
* parse asset as json if proper content type is given
*/
if (res.headers['content-type'] === 'application/json' && typeof res.body === 'string') {
res.body = JSON.parse(res.body);
}
return res.body;

@@ -518,3 +452,2 @@ } catch (err) {

}
async _callAPI(propName, ...args) {

@@ -528,21 +461,18 @@ const {

} = _constants.PROTOCOL_MAP.get(propName);
const params = (0, _utils.getParameters)(description.parameters);
const pathParams = params.filter(p => p.in === 'path');
/**
* validate required url params
*/
let url = endpoint;
for (const [i, urlParam] of Object.entries(pathParams)) {
const param = args[i];
const type = urlParam.type.replace('integer', 'number');
if (typeof param !== type) {
throw new Error(`Expected parameter for url param '${urlParam.name}' from type '${type}', found '${typeof param}'`);
}
url = url.replace(`{${urlParam.name}}`, param);
}
/**

@@ -552,17 +482,12 @@ * check for body param (as last parameter as we don't expect request

*/
let bodyOption = params.find(p => p.in === 'body') || description.requestBody ? args[pathParams.length] : null;
if (bodyOption && typeof bodyOption === 'string') {
bodyOption = JSON.parse(bodyOption);
}
/**
* validate required options
*/
const bodyMap = new Map();
const options = args.slice(pathParams.length)[0] || {};
for (const optionParam of params.filter(p => p.in === 'query')) {

@@ -573,7 +498,5 @@ const expectedType = optionParam.type.replace('integer', 'number');

const isRequired = Boolean(optionParam.required) || typeof optionParam.required === 'undefined' && typeof optionParam.default === 'undefined';
if ((isRequired || option) && !(0, _utils.isValidType)(option, expectedType)) {
throw new Error(`Expected parameter for option '${optionName}' from type '${expectedType}', found '${typeof option}'`);
}
if (typeof option !== 'undefined') {

@@ -583,2 +506,3 @@ bodyMap.set(optionParam.name, option);

}
/**

@@ -588,4 +512,2 @@ * get request body by using the body parameter or convert the parameter

*/
const body = bodyOption || [...bodyMap.entries()].reduce((e, [k, v]) => {

@@ -595,15 +517,15 @@ e[k] = v;

}, {});
/**
* stringify queryParams if stringifyOptions exists within description
*/
const modifiedParams = description.stringifyOptions ? _queryString.default.stringify(body, description.stringifyOptions) : body;
const modifiedParams = description.stringifyOptions ? (0, _queryString.stringify)(body, description.stringifyOptions) : body;
/**
* make request
*/
const uri = (0, _utils.getAPIHost)(servers, basePath, this._options) + url;
try {
const response = await this._api[method](uri, { ...(method === 'get' ? {
const response = await this._api[method](uri, {
...(method === 'get' ? {
searchParams: modifiedParams

@@ -620,5 +542,3 @@ } : {

}
}
exports.default = SauceLabs;

@@ -7,17 +7,9 @@ "use strict";

exports.default = void 0;
var _fs = require("fs");
var _util = require("util");
var _path = require("path");
var _download = _interopRequireDefault(require("download"));
var _downloader = _interopRequireDefault(require("@xhmikosr/downloader"));
var _constants = require("./constants");
var _utils = require("./utils");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**

@@ -45,2 +37,3 @@ * Note:

*/
class SauceConnectLoader {

@@ -50,7 +43,5 @@ constructor(options = {}) {

const platformData = _constants.SAUCE_CONNECT_PLATFORM_DATA[platform];
if (!platformData) {
throw new ReferenceError(`Unsupported platform ${platform}`);
}
const {

@@ -64,2 +55,3 @@ url,

}
/**

@@ -71,4 +63,2 @@ * Verify if SC was already downloaded,

*/
verifyAlreadyDownloaded() {

@@ -79,6 +69,6 @@ return _fs.promises.stat(this.path).catch(err => {

}
throw err;
});
}
/**

@@ -89,8 +79,8 @@ * Download SC

*/
_download() {
return (0, _download.default)(this.url, this.dest, {
return (0, _downloader.default)(this.url, this.dest, {
extract: true,
strip: 1
decompress: {
strip: 1
}
}).then(() => {

@@ -103,5 +93,3 @@ if (process.platform !== 'win32') {

}
}
exports.default = SauceConnectLoader;

@@ -16,13 +16,7 @@ "use strict";

exports.toString = toString;
var _crypto = _interopRequireDefault(require("crypto"));
var _tunnel = _interopRequireDefault(require("tunnel"));
var _url = _interopRequireDefault(require("url"));
var _constants = require("./constants");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**

@@ -38,3 +32,2 @@ * Create HMAC token to receive job assets

const hmac = _crypto.default.createHmac('md5', `${username}:${key}`);
hmac.write(jobId);

@@ -44,10 +37,9 @@ hmac.end();

const data = hmac.read();
if (!data) {
return reject(new Error('Could not create HMAC token'));
}
return resolve(data.toString('hex'));
}));
}
/**

@@ -58,4 +50,2 @@ * Translate region shorthandle option into the full region

*/
function getRegionSubDomain(options = {}) {

@@ -69,2 +59,3 @@ let region = options.region || 'us-west-1';

}
/**

@@ -77,4 +68,2 @@ * get sauce API url

*/
function getAPIHost(servers, basePath, options) {

@@ -85,2 +74,3 @@ /**

let host = (options.host || servers[0].url) + basePath;
/**

@@ -90,22 +80,19 @@ * allow short region handles to stay backwards compatible

*/
if (options.region) {
options.region = getRegionSubDomain(options);
}
for (const [option, value] of Object.entries(servers[0].variables)) {
const hostOption = options[option] || value.default;
/**
* check if option is valid
*/
if (!value.enum.includes(hostOption)) {
throw new Error(`Option "${option}" contains invalid value ("${hostOption}"), allowed are: ${value.enum.join(', ')}`);
}
host = host.replace(`{${option}}`, hostOption);
}
return host;
}
/**

@@ -118,4 +105,2 @@ * helper to generate host for assets, like:

*/
function getAssetHost(options) {

@@ -125,7 +110,5 @@ if (options.headless) {

}
if (options.region === 'staging') {
options.tld = options.tld || 'net';
}
const tld = options.tld || 'com';

@@ -135,2 +118,3 @@ const region = _constants.ASSET_REGION_MAPPING[options.region] || '';

}
/**

@@ -141,4 +125,2 @@ * toString method for proxy instance

*/
function toString(scope) {

@@ -153,2 +135,3 @@ return `${_constants.TO_STRING_TAG} {

}
/**

@@ -159,4 +142,2 @@ * get sorted list of parameters with full description

*/
function getParameters(parameters = []) {

@@ -168,10 +149,9 @@ const params = parameters.map(urlParameter => urlParameter.$ref ? _constants.PARAMETERS_MAP.get(urlParameter.$ref.split('/').slice(-1)[0]) : urlParameter);

}
if (a.required && !b.required) {
return -1;
}
return 1;
});
}
/**

@@ -183,4 +163,2 @@ * type check for endpoint parameters

*/
function isValidType(option, expectedType) {

@@ -190,5 +168,5 @@ if (expectedType === 'array') {

}
return typeof option === expectedType;
}
/**

@@ -199,7 +177,4 @@ * get a tunnel Agent for proxy tunneling

*/
function createProxyAgent(proxy) {
var proxyURL = _url.default.parse(proxy);
if (proxyURL.protocol === 'https:') {

@@ -224,5 +199,5 @@ return {

}
throw new Error('Only http and https protocols are supported for proxying traffic.' + `\nWe got ${proxyURL.protocol}`);
}
/**

@@ -232,14 +207,11 @@ * If the environment variable "STRICT_SSL" is defined as "false", it doesn't require SSL certificates to be valid.

*/
function getStrictSsl() {
return !(process.env.STRICT_SSL === 'false' || process.env.strict_ssl === 'false');
}
/**
* Mainly just here for testing
*/
function getPlatform() {
return process.platform;
}

@@ -7,11 +7,6 @@ "use strict";

exports.handler = exports.describe = exports.command = exports.builder = void 0;
require("source-map-support/register");
var _ = _interopRequireDefault(require("./.."));
var _constants = require("../constants");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const command = 'sc [flags]';

@@ -21,3 +16,2 @@ exports.command = command;

exports.describe = describe;
const builder = yargs => {

@@ -28,5 +22,3 @@ for (const option of _constants.SAUCE_CONNECT_CLI_PARAMS) {

};
exports.builder = builder;
const handler = async argv => {

@@ -49,4 +41,3 @@ const {

};
exports.handler = handler;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21tYW5kcy9zYy5qcyJdLCJuYW1lcyI6WyJjb21tYW5kIiwiZGVzY3JpYmUiLCJidWlsZGVyIiwieWFyZ3MiLCJvcHRpb24iLCJTQVVDRV9DT05ORUNUX0NMSV9QQVJBTVMiLCJuYW1lIiwiaGFuZGxlciIsImFyZ3YiLCJ1c2VyIiwia2V5IiwiaGVhZGxlc3MiLCJyZWdpb24iLCJwcm94eSIsIk9iamVjdCIsImFzc2lnbiIsIkRFRkFVTFRfT1BUSU9OUyIsImFwaSIsIlNhdWNlTGFicyIsInN0YXJ0U2F1Y2VDb25uZWN0Il0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7QUFBQTs7QUFDQTs7OztBQUVPLE1BQU1BLE9BQU8sR0FBRyxZQUFoQjs7QUFDQSxNQUFNQyxRQUFRLEdBQUcseUJBQWpCOzs7QUFDQSxNQUFNQyxPQUFPLEdBQUlDLEtBQUQsSUFBVztBQUNoQyxPQUFLLE1BQU1DLE1BQVgsSUFBcUJDLG1DQUF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QUFDN0IsTUFBTUUsUUFBUSxHQUFHLHlCQUF5QjtBQUFDRCxPQUFBLENBQUFDLFFBQUEsR0FBQUEsUUFBQTtBQUMzQyxNQUFNQyxPQUFPLEdBQUlDLEtBQUssSUFBSztFQUNoQyxLQUFLLE1BQU1DLE1BQU0sSUFBSUMsbUNBQXdCLEVBQUU7SUFDN0NGLEtBQUssQ0FBQ0MsTUFBTSxDQUFDQSxNQUFNLENBQUNFLElBQUksRUFBRUYsTUFBTSxDQUFDO0VBQ25DO0FBQ0YsQ0FBQztBQUFDSixPQUFBLENBQUFFLE9BQUEsR0FBQUEsT0FBQTtBQUNLLE1BQU1LLE9BQU8sR0FBRyxNQUFPQyxJQUFJLElBQUs7RUFDckMsTUFBTTtJQUFDQyxJQUFJO0lBQUVDLEdBQUc7SUFBRUMsUUFBUTtJQUFFQyxNQUFNO0lBQUVDO0VBQUssQ0FBQyxHQUFHQyxNQUFNLENBQUNDLE1BQU0sQ0FDeEQsQ0FBQyxDQUFDLEVBQ0ZDLDBCQUFlLEVBQ2ZSLElBQ0YsQ0FBQztFQUNELE1BQU1TLEdBQUcsR0FBRyxJQUFJQyxTQUFTLENBQUM7SUFBQ1QsSUFBSTtJQUFFQyxHQUFHO0lBQUVDLFFBQVE7SUFBRUMsTUFBTTtJQUFFQztFQUFLLENBQUMsQ0FBQztFQUMvRCxPQUFPSSxHQUFHLENBQUNFLGlCQUFpQixDQUFDWCxJQUFJLEVBQUUsSUFBSSxDQUFDO0FBQzFDLENBQUM7QUFBQ1IsT0FBQSxDQUFBTyxPQUFBLEdBQUFBLE9BQUEifQ==
import SauceLabs from '../build';
const ID = process.env.GITHUB_RUN_ID ?? '(local)';
// Only run the test when the env var is present
// in GitHub Actions, otherwise it fails for untrusted PRs/
const SKIP_TEST = process.env.GITHUB_RUN_ID && !process.env.SAUCE_USERNAME;

@@ -11,3 +14,3 @@ jest.setTimeout(60 * 1000); // 60s should be sufficient to boot SC

jest
.unmock('download')
.unmock('@xhmikosr/downloader')
.unmock('form-data')

@@ -19,2 +22,5 @@ .unmock('got')

test('should not be able to run Sauce Connect due to invalid credentials', async () => {
if (SKIP_TEST) {
return;
}
const api = new SauceLabs({key: 'foobar'});

@@ -31,2 +37,5 @@ const err = await api

test('should be able to run Sauce Connect', async () => {
if (SKIP_TEST) {
return;
}
const api = new SauceLabs();

@@ -33,0 +42,0 @@ const sc = await api.startSauceConnect({

{
"name": "saucelabs",
"version": "7.2.2",
"version": "7.2.3",
"author": "Sauce Labs, Inc.",

@@ -42,8 +42,8 @@ "description": "A wrapper around Sauce Labs REST API",

"dependencies": {
"@xhmikosr/downloader": "^13.0.1",
"change-case": "^4.1.2",
"download": "^8.0.0",
"form-data": "^4.0.0",
"got": "^11.8.2",
"got": "^12.6.1",
"hash.js": "^1.1.7",
"query-string": "^7.0.1",
"query-string": "^8.1.0",
"tunnel": "^0.0.6",

@@ -53,18 +53,18 @@ "yargs": "^17.2.1"

"devDependencies": {
"@babel/cli": "^7.15.7",
"@babel/core": "^7.15.8",
"@babel/node": "^7.15.8",
"@babel/preset-env": "^7.15.8",
"@babel/cli": "^7.22.10",
"@babel/core": "^7.22.11",
"@babel/node": "^7.22.10",
"@babel/preset-env": "^7.22.14",
"@babel/register": "^7.15.3",
"babel-plugin-source-map-support": "^2.1.3",
"eslint": "^8.15.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"husky": "^7.0.4",
"jest": "^27.3.0",
"lint-staged": "^12.4.1",
"babel-plugin-source-map-support": "^2.2.0",
"eslint": "^8.48.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.28.1",
"husky": "^8.0.3",
"jest": "^29.6.4",
"lint-staged": "^14.0.1",
"npm-run-all": "^4.1.5",
"prettier": "^2.6.2",
"release-it": "^14.11.6",
"rimraf": "^3.0.2",
"release-it": "^15.11.0",
"rimraf": "^5.0.1",
"source-map-support": "^0.5.20",

@@ -71,0 +71,0 @@ "swagger-typescript-codegen": "^3.2.4",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc