Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
deekshas8 committed Jul 8, 2024
1 parent 1e279de commit e2fc2a3
Showing 1 changed file with 29 additions and 4 deletions.
33 changes: 29 additions & 4 deletions packages/gen-ai-hub/src/client/openai/openai-client.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import fs from 'fs';
import path from 'path';
import nock from 'nock';
import { HttpDestination } from '@sap-cloud-sdk/connectivity';
import { mockGetAiCoreDestination } from '../../../../../test-util/mock-context.js';
Expand Down Expand Up @@ -56,7 +57,13 @@ describe('openai client', () => {
...deploymentConfig
};
const mockResponse = fs.readFileSync(
'test-util/mock-data/openai-chat-completion-success-response.json',
path.join(
'..',
'..',
'test-util',
'mock-data',
'openai-chat-completion-success-response.json'
),
'utf8'
);

Expand Down Expand Up @@ -87,7 +94,13 @@ describe('openai client', () => {
...deploymentConfig
};
const mockResponse = fs.readFileSync(
'test-util/mock-data/openai-error-response.json',
path.join(
'..',
'..',
'test-util',
'mock-data',
'openai-error-response.json'
),
'utf8'
);

Expand All @@ -113,7 +126,13 @@ describe('openai client', () => {
...deploymentConfig
};
const mockResponse = fs.readFileSync(
'test-util/mock-data/openai-embeddings-success-response.json',
path.join(
'..',
'..',
'test-util',
'mock-data',
'openai-embeddings-success-response.json'
),
'utf8'
);

Expand Down Expand Up @@ -143,7 +162,13 @@ describe('openai client', () => {
...deploymentConfig
};
const mockResponse = fs.readFileSync(
'test-util/mock-data/openai-error-response.json',
path.join(
'..',
'..',
'test-util',
'mock-data',
'openai-error-response.json'
),
'utf8'
);

Expand Down

0 comments on commit e2fc2a3

Please sign in to comment.