Skip to content

Commit 6ac5e25

Browse files
committed
Revert changed file to main
1 parent 32a5d47 commit 6ac5e25

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

tests/index.test.ts

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
import { APIPromise } from '@kernel/sdk/core/api-promise';
3+
import { APIPromise } from '@onkernel/sdk/core/api-promise';
44

55
import util from 'node:util';
6-
import Kernel from '@kernel/sdk';
7-
import { APIUserAbortError } from '@kernel/sdk';
6+
import Kernel from '@onkernel/sdk';
7+
import { APIUserAbortError } from '@onkernel/sdk';
88
const defaultFetch = fetch;
99

1010
describe('instantiate client', () => {
@@ -329,20 +329,22 @@ describe('instantiate client', () => {
329329
process.env['KERNEL_BASE_URL'] = ' '; // blank
330330
const client = new Kernel({ apiKey: 'My API Key' });
331331
expect(client.baseURL).toEqual('https://api.onkernel.com/');
332-
expect(client.baseURL).toEqual('https://api.onkernel.com/');
333-
});
332+
});
334333

335-
test('blank env variable', () => {
336-
process.env['KERNEL_BASE_URL'] = ' '; // blank
337-
const client = new Kernel({ apiKey: 'My API Key' });
338-
expect(client.baseURL).toEqual('https://api.onkernel.com/');
339-
});
334+
test('env variable with environment', () => {
335+
process.env['KERNEL_BASE_URL'] = 'https://example.com/from_env';
340336

341-
test('env variable with environment', () => {
342-
@@ -345,7 +345,7 @@ describe('instantiate client', () => {
343-
baseURL: null,
344-
environment: 'production',
345-
});
337+
expect(
338+
() => new Kernel({ apiKey: 'My API Key', environment: 'production' }),
339+
).toThrowErrorMatchingInlineSnapshot(
340+
`"Ambiguous URL; The \`baseURL\` option (or KERNEL_BASE_URL env var) and the \`environment\` option are given. If you want to use the environment you must pass baseURL: null"`,
341+
);
342+
343+
const client = new Kernel({
344+
apiKey: 'My API Key',
345+
baseURL: null,
346+
environment: 'production',
347+
});
346348
expect(client.baseURL).toEqual('https://api.onkernel.com/');
347349
});
348350

0 commit comments

Comments
 (0)