Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = {
collectCoverage: true,
coverageThreshold: {
global: {
branches: 93.5,
branches: 93,
functions: 98,
lines: 97,
statements: 97,
Expand Down
4 changes: 2 additions & 2 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import os from 'os';

import {version} from '../package.json';

export const DEFAULT_SAUCE_CONNECT_VERSION = '5.2.2';
export const DEFAULT_SAUCE_CONNECT_VERSION = '5';
export const DEFAULT_RUNNER_NAME = 'node-saucelabs';
export const SAUCE_VERSION_NOTE = `node-saucelabs v${version}\nSauce Connect v${DEFAULT_SAUCE_CONNECT_VERSION}`;
export const SAUCE_VERSION_NOTE = `node-saucelabs v${version}\nSauce Connect v5 (latest)`;

const protocols = [
require('../apis/sauce.json'),
Expand Down
13 changes: 13 additions & 0 deletions tests/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,19 @@ test('should get user by username', async () => {
expect(got.mock.calls[0]).toMatchSnapshot();
});

test('should get user by username fail when api fails', async () => {
const api = new SauceLabs({user: 'foo', key: 'bar'});
got.mockReturnValue(Promise.reject(new Error('example')));
const error = await api
.getUserByUsername({username: 'fooUser'})
.catch((err) => err);
expect(error).toEqual(
new Error(
'There was an error while fetching user information: Failed calling getUsersV1: example, undefined'
)
);
});

test('should get list of builds', async () => {
const api = new SauceLabs({user: 'foo', key: 'bar'});
got
Expand Down