Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use latest sauce connect 5 version by default #277

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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';
Copy link

@Choraden Choraden Jan 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it run a container or how will it know latest version?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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