🧪 fix(ci): update failing initializeClient tests with new expected values (#1982)

* fix(ci): update failing tests with new expected values from `getUserKey`

* refactor: safer optional chaining, and ensure apiKey is defined
This commit is contained in:
Danny Avila 2024-03-05 14:33:45 -05:00 committed by GitHub
parent 2ea6e8c18a
commit 7a6a41a72e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 20 additions and 18 deletions

View file

@ -60,8 +60,8 @@ const initializeClient = async ({ req, res, endpointOption }) => {
}
}
let apiKey = userProvidesKey ? userValues.apiKey : CUSTOM_API_KEY;
let baseURL = userProvidesURL ? userValues.baseURL : CUSTOM_BASE_URL;
let apiKey = userProvidesKey ? userValues?.apiKey : CUSTOM_API_KEY;
let baseURL = userProvidesURL ? userValues?.baseURL : CUSTOM_BASE_URL;
if (!apiKey) {
throw new Error(`${endpoint} API key not provided.`);