Skip to content
Merged
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
9 changes: 9 additions & 0 deletions tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,15 @@ describe('instantiate client', () => {
expect(response).toEqual({ url: 'http://localhost:5000/foo', custom: true });
});

test('explicit global fetch', async () => {
// make sure the global fetch type is assignable to our Fetch type
const client = new Anthropic({
baseURL: 'http://localhost:5000/',
apiKey: 'my-anthropic-api-key',
fetch: defaultFetch,
});
});

test('custom signal', async () => {
const client = new Anthropic({
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
Expand Down