🧪 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

@ -340,9 +340,10 @@ describe('gptPlugins/initializeClient', () => {
test('should initialize client with default options when certain env vars are not set', async () => {
delete process.env.DEBUG_OPENAI;
delete process.env.OPENAI_SUMMARIZE;
process.env.OPENAI_API_KEY = 'some-api-key';
const req = {
body: { key: null, endpoint: 'openAI' },
body: { key: null, endpoint: EModelEndpoint.gptPlugins },
user: { id: '123' },
app,
};