Skip to content

Commit f2cd918

Browse files
committed
try fix
1 parent b048f02 commit f2cd918

File tree

4 files changed

+5
-9
lines changed

4 files changed

+5
-9
lines changed

jest.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const config: JestConfigWithTsJest = {
1717
'<rootDir>/deno_tests/',
1818
],
1919
testPathIgnorePatterns: ['scripts'],
20-
prettierPath: require.resolve('prettier-2'),
20+
// prettierPath: require.resolve('prettier-2'),
2121
};
2222

2323
export default config;

tests/lib/ChatCompletionRunFunctions.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
type ChatCompletionStreamingFunctionRunnerParams,
1010
} from 'openai/resources/beta/chat/completions';
1111
import type { ChatCompletionMessageParam } from 'openai/resources/chat/completions';
12-
import { Response } from 'node-fetch';
1312
import { isAssistantMessage } from '../../src/lib/chatCompletionUtils';
1413
import { mockFetch } from '../utils/mock-fetch';
1514

tests/utils/mock-fetch.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
import { type RequestInfo, type RequestInit } from 'openai/_shims/index';
2-
import { Response } from 'node-fetch';
3-
4-
type Fetch = (req: string | RequestInfo, init?: RequestInit) => Promise<Response>;
1+
import { type Fetch, type RequestInfo, type RequestInit, type Response } from 'openai/internal/builtin-types';
52

63
/**
74
* Creates a mock `fetch` function and a `handleRequest` function for intercepting `fetch` calls.

tests/utils/mock-snapshots.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import defaultFetch, { Response } from 'node-fetch';
21
import OpenAI from 'openai/index';
3-
import { RequestInit } from 'openai/_shims/auto/types';
4-
import { RequestInfo } from 'openai/_shims/auto/types';
2+
import { RequestInfo } from 'openai/internal/builtin-types';
53
import { mockFetch } from './mock-fetch';
64
import { Readable } from 'stream';
75

6+
const defaultFetch = fetch;
7+
88
export async function makeSnapshotRequest<T>(
99
requestFn: (client: OpenAI) => Promise<T>,
1010
snapshotIndex = 1,

0 commit comments

Comments
 (0)