Skip to content

Commit 98aa96c

Browse files
chore: break long lines in snippets into multiline
1 parent 6bd64d9 commit 98aa96c

File tree

1 file changed

+55
-11
lines changed

1 file changed

+55
-11
lines changed

tests/index.test.ts

Lines changed: 55 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,11 @@ describe('instantiate client', () => {
8787
error: jest.fn(),
8888
};
8989

90-
const client = new WarpAPI({ logger: logger, logLevel: 'debug', apiKey: 'My API Key' });
90+
const client = new WarpAPI({
91+
logger: logger,
92+
logLevel: 'debug',
93+
apiKey: 'My API Key',
94+
});
9195

9296
await forceAPIResponseForClient(client);
9397
expect(debugMock).toHaveBeenCalled();
@@ -107,7 +111,11 @@ describe('instantiate client', () => {
107111
error: jest.fn(),
108112
};
109113

110-
const client = new WarpAPI({ logger: logger, logLevel: 'info', apiKey: 'My API Key' });
114+
const client = new WarpAPI({
115+
logger: logger,
116+
logLevel: 'info',
117+
apiKey: 'My API Key',
118+
});
111119

112120
await forceAPIResponseForClient(client);
113121
expect(debugMock).not.toHaveBeenCalled();
@@ -157,7 +165,11 @@ describe('instantiate client', () => {
157165
};
158166

159167
process.env['WARP_API_LOG'] = 'debug';
160-
const client = new WarpAPI({ logger: logger, logLevel: 'off', apiKey: 'My API Key' });
168+
const client = new WarpAPI({
169+
logger: logger,
170+
logLevel: 'off',
171+
apiKey: 'My API Key',
172+
});
161173

162174
await forceAPIResponseForClient(client);
163175
expect(debugMock).not.toHaveBeenCalled();
@@ -173,7 +185,11 @@ describe('instantiate client', () => {
173185
};
174186

175187
process.env['WARP_API_LOG'] = 'not a log level';
176-
const client = new WarpAPI({ logger: logger, logLevel: 'debug', apiKey: 'My API Key' });
188+
const client = new WarpAPI({
189+
logger: logger,
190+
logLevel: 'debug',
191+
apiKey: 'My API Key',
192+
});
177193
expect(client.logLevel).toBe('debug');
178194
expect(warnMock).not.toHaveBeenCalled();
179195
});
@@ -267,7 +283,11 @@ describe('instantiate client', () => {
267283
return new Response(JSON.stringify({}), { headers: { 'Content-Type': 'application/json' } });
268284
};
269285

270-
const client = new WarpAPI({ baseURL: 'http://localhost:5000/', apiKey: 'My API Key', fetch: testFetch });
286+
const client = new WarpAPI({
287+
baseURL: 'http://localhost:5000/',
288+
apiKey: 'My API Key',
289+
fetch: testFetch,
290+
});
271291

272292
await client.patch('/foo');
273293
expect(capturedRequest?.method).toEqual('PATCH');
@@ -345,7 +365,11 @@ describe('instantiate client', () => {
345365

346366
describe('withOptions', () => {
347367
test('creates a new client with overridden options', async () => {
348-
const client = new WarpAPI({ baseURL: 'http://localhost:5000/', maxRetries: 3, apiKey: 'My API Key' });
368+
const client = new WarpAPI({
369+
baseURL: 'http://localhost:5000/',
370+
maxRetries: 3,
371+
apiKey: 'My API Key',
372+
});
349373

350374
const newClient = client.withOptions({
351375
maxRetries: 5,
@@ -385,7 +409,11 @@ describe('instantiate client', () => {
385409
});
386410

387411
test('respects runtime property changes when creating new client', () => {
388-
const client = new WarpAPI({ baseURL: 'http://localhost:5000/', timeout: 1000, apiKey: 'My API Key' });
412+
const client = new WarpAPI({
413+
baseURL: 'http://localhost:5000/',
414+
timeout: 1000,
415+
apiKey: 'My API Key',
416+
});
389417

390418
// Modify the client properties directly after creation
391419
client.baseURL = 'http://localhost:6000/';
@@ -531,7 +559,11 @@ describe('retries', () => {
531559
return new Response(JSON.stringify({ a: 1 }), { headers: { 'Content-Type': 'application/json' } });
532560
};
533561

534-
const client = new WarpAPI({ apiKey: 'My API Key', timeout: 10, fetch: testFetch });
562+
const client = new WarpAPI({
563+
apiKey: 'My API Key',
564+
timeout: 10,
565+
fetch: testFetch,
566+
});
535567

536568
expect(await client.request({ path: '/foo', method: 'get' })).toEqual({ a: 1 });
537569
expect(count).toEqual(2);
@@ -561,7 +593,11 @@ describe('retries', () => {
561593
return new Response(JSON.stringify({ a: 1 }), { headers: { 'Content-Type': 'application/json' } });
562594
};
563595

564-
const client = new WarpAPI({ apiKey: 'My API Key', fetch: testFetch, maxRetries: 4 });
596+
const client = new WarpAPI({
597+
apiKey: 'My API Key',
598+
fetch: testFetch,
599+
maxRetries: 4,
600+
});
565601

566602
expect(await client.request({ path: '/foo', method: 'get' })).toEqual({ a: 1 });
567603

@@ -585,7 +621,11 @@ describe('retries', () => {
585621
capturedRequest = init;
586622
return new Response(JSON.stringify({ a: 1 }), { headers: { 'Content-Type': 'application/json' } });
587623
};
588-
const client = new WarpAPI({ apiKey: 'My API Key', fetch: testFetch, maxRetries: 4 });
624+
const client = new WarpAPI({
625+
apiKey: 'My API Key',
626+
fetch: testFetch,
627+
maxRetries: 4,
628+
});
589629

590630
expect(
591631
await client.request({
@@ -647,7 +687,11 @@ describe('retries', () => {
647687
capturedRequest = init;
648688
return new Response(JSON.stringify({ a: 1 }), { headers: { 'Content-Type': 'application/json' } });
649689
};
650-
const client = new WarpAPI({ apiKey: 'My API Key', fetch: testFetch, maxRetries: 4 });
690+
const client = new WarpAPI({
691+
apiKey: 'My API Key',
692+
fetch: testFetch,
693+
maxRetries: 4,
694+
});
651695

652696
expect(
653697
await client.request({

0 commit comments

Comments
 (0)