generated from stijnvanhulle/template
-
-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: use of testing files instead of snapshots
- Loading branch information
1 parent
140adac
commit 76fb011
Showing
105 changed files
with
935 additions
and
1,115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 0 additions & 34 deletions
34
packages/plugin-client/src/generators/__snapshots__/clientGenerator.test.tsx.snap
This file was deleted.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
packages/plugin-client/src/generators/__snapshots__/createPet.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/** | ||
* @summary Create a pet | ||
* @link /pets | ||
*/ | ||
export async function createPet(data: CreatePet, options: Partial<Parameters<typeof client>[0]> = {}): Promise<ResponseConfig<CreatePet>['data']> { | ||
const res = await client<CreatePet, CreatePet>({ method: 'post', url: `/pets`, data, ...options }) | ||
return res.data | ||
} |
8 changes: 8 additions & 0 deletions
8
packages/plugin-client/src/generators/__snapshots__/getPets.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/** | ||
* @summary List all pets | ||
* @link /pets | ||
*/ | ||
export async function getPets(params?: GetPets, options: Partial<Parameters<typeof client>[0]> = {}): Promise<ResponseConfig<GetPets>['data']> { | ||
const res = await client<GetPets>({ method: 'get', url: `/pets`, params, ...options }) | ||
return res.data | ||
} |
8 changes: 8 additions & 0 deletions
8
packages/plugin-client/src/generators/__snapshots__/getPetsFull.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/** | ||
* @summary List all pets | ||
* @link /pets | ||
*/ | ||
export async function getPetsFull(params?: GetPetsFull, options: Partial<Parameters<typeof client>[0]> = {}): Promise<ResponseConfig<GetPetsFull>> { | ||
const res = await client<GetPetsFull>({ method: 'get', url: `/pets`, params, ...options }) | ||
return res | ||
} |
14 changes: 14 additions & 0 deletions
14
packages/plugin-client/src/generators/__snapshots__/operations.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export const operations = { | ||
listPets: { | ||
path: '/pets', | ||
method: 'get', | ||
}, | ||
createPets: { | ||
path: '/pets', | ||
method: 'post', | ||
}, | ||
showPetById: { | ||
path: '/pets/:petId', | ||
method: 'get', | ||
}, | ||
} as const |
18 changes: 0 additions & 18 deletions
18
packages/plugin-client/src/generators/__snapshots__/operationsGenerator.test.tsx.snap
This file was deleted.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
packages/plugin-client/src/generators/__snapshots__/showPetById.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** | ||
* @summary Info for a specific pet | ||
* @link /pets/:petId | ||
*/ | ||
export async function showPetById( | ||
petId: ShowPetById['petId'], | ||
testId: ShowPetById['testId'], | ||
options: Partial<Parameters<typeof client>[0]> = {}, | ||
): Promise<ResponseConfig<ShowPetById>['data']> { | ||
const res = await client<ShowPetById>({ method: 'get', url: `/pets/${petId}`, ...options }) | ||
return res.data | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
packages/plugin-faker/src/generators/__snapshots__/createPet.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/** | ||
* @description Null response | ||
*/ | ||
export function createPet(): NonNullable<CreatePet> { | ||
return unknown | ||
} | ||
|
||
/** | ||
* @description unexpected error | ||
*/ | ||
export function createPet(): NonNullable<CreatePet> { | ||
return createPet() | ||
} | ||
|
||
export function createPet(data: NonNullable<Partial<CreatePet>> = {}): NonNullable<CreatePet> { | ||
return { | ||
...{ name: faker.string.alpha(), tag: faker.string.alpha() }, | ||
...data, | ||
} | ||
} | ||
|
||
export function createPet(): NonNullable<CreatePet> { | ||
return unknown | ||
} |
120 changes: 0 additions & 120 deletions
120
packages/plugin-faker/src/generators/__snapshots__/fakerGenerator.test.tsx.snap
This file was deleted.
Oops, something went wrong.
27 changes: 27 additions & 0 deletions
27
packages/plugin-faker/src/generators/__snapshots__/getPets.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
export function getPets(data: NonNullable<Partial<GetPets>> = {}): NonNullable<GetPets> { | ||
return { | ||
...{ limit: faker.string.alpha() }, | ||
...data, | ||
} | ||
} | ||
|
||
/** | ||
* @description A paged array of pets | ||
*/ | ||
export function getPets(): NonNullable<GetPets> { | ||
return getPets() | ||
} | ||
|
||
/** | ||
* @description unexpected error | ||
*/ | ||
export function getPets(): NonNullable<GetPets> { | ||
return getPets() | ||
} | ||
|
||
/** | ||
* @description A paged array of pets | ||
*/ | ||
export function getPets(): NonNullable<GetPets> { | ||
return getPets() | ||
} |
Oops, something went wrong.