feat(fetch): add fetcher option to support custom fetch function injection
#306
Annotations
5 errors
|
pr-checks (ubuntu-latest, 22.x)
Process completed with exit code 1.
|
|
pr-checks (ubuntu-latest, 22.x)
swr-with-zod#test:snapshots: command (/home/runner/work/orval/orval/samples/swr-with-zod) /home/runner/.bun/bin/bun run test:snapshots exited (1)
|
|
[swr-with-zod] api-generation.spec.ts > API Generation Snapshots > samples/swr-with-zod/src/gen/endpoints/pets/pets.ts:
test-utils/snapshot-testing.ts#L75
Error: Snapshot `API Generation Snapshots > samples/swr-with-zod/src/gen/endpoints/pets/pets.ts 1` mismatched
- Expected
+ Received
@@ -118,13 +118,12 @@
};
export const listPets = async (
params?: ListPetsParams,
options?: RequestInit,
- fetchFn?: typeof globalThis.fetch,
): Promise<listPetsResponse> => {
- const res = await (fetchFn ?? fetch)(getListPetsUrl(params), {
+ const res = await fetch(getListPetsUrl(params), {
...options,
method: 'GET',
});
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
@@ -200,13 +199,12 @@
};
export const createPets = async (
createPetsBodyItem: CreatePetsBodyItem[],
options?: RequestInit,
- fetchFn?: typeof globalThis.fetch,
): Promise<createPetsResponse> => {
- const res = await (fetchFn ?? fetch)(getCreatePetsUrl(), {
+ const res = await fetch(getCreatePetsUrl(), {
...options,
method: 'POST',
headers: { 'Content-Type': 'application/json', ...options?.headers },
body: JSON.stringify(createPetsBodyItem),
});
@@ -287,13 +285,12 @@
};
export const updatePets = async (
pet: NonReadonly<Pet>,
options?: RequestInit,
- fetchFn?: typeof globalThis.fetch,
): Promise<updatePetsResponse> => {
- const res = await (fetchFn ?? fetch)(getUpdatePetsUrl(), {
+ const res = await fetch(getUpdatePetsUrl(), {
...options,
method: 'PUT',
headers: { 'Content-Type': 'application/json', ...options?.headers },
body: JSON.stringify(pet),
});
@@ -374,13 +371,12 @@
};
export const showPetById = async (
petId: string,
options?: RequestInit,
- fetchFn?: typeof globalThis.fetch,
): Promise<showPetByIdResponse> => {
- const res = await (fetchFn ?? fetch)(getShowPetByIdUrl(petId), {
+ const res = await fetch(getShowPetByIdUrl(petId), {
...options,
method: 'GET',
});
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
❯ ../../test-utils/snapshot-testing.ts:75:9
|
|
pr-checks (windows-latest, 22.x)
The strategy configuration was canceled because "pr-checks.ubuntu-latest_22_x" failed
|
|
pr-checks (windows-latest, 22.x)
The operation was canceled.
|