Skip to content
Myr

Fix CI

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Sindre Sorhus · committed by Sindre Sorhus · parent d93adf8 · Browse files · 4 files+10 added−7 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

4 files+10 added−7 removed

  • tests:+9 added−6 removed
  • other:+1 added−1 removed

4 files+10 added−7 removed

modified:test/request-construction.ts+1 added-2 removed
320 unmodified lines
321322 t.is(requests[0]!.headers.get('content-type'), 'multipart/form-data; boundary=custom');323});324325// The `Request` constructor only normalizes the methods the Fetch standard lists, so a lowercase `query` on a `Request` input is still lowercase when Ky reads it.325// The `Request` constructor only normalizes the methods the Fetch standard lists. Runtimes from before `QUERY` was added keep a lowercase `query` on a `Request` input, so Ky must uppercase it.326test('a standard method from a Request input is uppercased', async t => {327 const {fetch, requests} = createRecordingFetch();328 const input = new Request('https://example.com/', {method: 'query'});329 t.is(input.method, 'query');329330 await ky(input, {fetch, retry: 0});331332 t.is(requests[0]!.method, 'QUERY');
72 unmodified lines
modified:test/resilience.ts+6 added-2 removed
479 unmodified lines
480 const transport = scriptedFetch([busy(), 'hang', ready()]);481 const controller = new AbortController();482483 const result = observe(client(transport)(url, {signal: controller.signal}));484 await delay(80);485 t.is(transport.attempts, 2);484 // Wait for the retry to start, since a busy machine can stretch the retry delay.485 while (transport.attempts < 2) {486 // eslint-disable-next-line no-await-in-loop487 await delay(5);488 }489490 controller.abort();491 await delay(50);492493 t.true(result.settled);
628 unmodified lines
modified:test/retry.ts+2 added-2 removed
4815 unmodified lines
48164817// `beforeError` hooks run after an error is produced, so they are not bounded by `totalTimeout`.4818test('totalTimeout does not bound a beforeError hook', async t => {4819 const error = await t.throwsAsync(ky('https://example.com', {4820 totalTimeout: 50,4820 totalTimeout: 500,4821 timeout: false,4822 retry: 0,4823 hooks: {4824 beforeError: [async ({error}) => {4825 await delay(200);4825 await delay(600);4826 return new Error(`rewritten: ${error.name}`);4827 }],4828 },4829 async fetch() {
585 unmodified lines
modified:test-d/fetch-extensions.ts+1 added-1 removed