Skip to content
Open
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
15 changes: 4 additions & 11 deletions lib/commons/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,10 @@
};

const getApiKey = ({ apiKey, token }) => {
let calculatedApiKey = apiKey;
if (!calculatedApiKey) {
calculatedApiKey = token;
if (!calculatedApiKey) {
throw new ReportPortalRequiredOptionError('apiKey');
} else {
console.warn(`Option 'token' is deprecated. Use 'apiKey' instead.`);
}
}

return calculatedApiKey;
if (apiKey) return apiKey;

Check failure on line 21 in lib/commons/config.js

View workflow job for this annotation

GitHub Actions / test (20)

Delete `··`

Check failure on line 21 in lib/commons/config.js

View workflow job for this annotation

GitHub Actions / test (18)

Delete `··`

Check failure on line 21 in lib/commons/config.js

View workflow job for this annotation

GitHub Actions / test (22)

Delete `··`
if (!token) throw new ReportPortalRequiredOptionError('apiKey');
console.warn(`Option 'token' is deprecated. Use 'apiKey' instead.`);

Check warning on line 23 in lib/commons/config.js

View workflow job for this annotation

GitHub Actions / test (20)

Unexpected console statement

Check warning on line 23 in lib/commons/config.js

View workflow job for this annotation

GitHub Actions / test (18)

Unexpected console statement

Check warning on line 23 in lib/commons/config.js

View workflow job for this annotation

GitHub Actions / test (22)

Unexpected console statement
return token;
};

const getClientConfig = (options) => {
Expand Down
Loading