Skip to content

Commit f51ad5c

Browse files
committed
minor(emitter-fetch-client): fix tests
1 parent c043cde commit f51ad5c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

packages/emitter-fetch-client/test/emitter.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ describe("emitter-fetch-client", () => {
131131
);
132132
assert.match(
133133
contents,
134-
/export type listPetsResponseBody = { pets: Pet\[\] };/
134+
/export type listPetsResponseBody = {\n\s+data: { pets: PetFromOperation\[\] };\n\s+statusCode: 200;\n\s+};/
135135
);
136136
});
137137

@@ -145,7 +145,7 @@ describe("emitter-fetch-client", () => {
145145
it("emits the route callback type", () => {
146146
assert.match(
147147
contents,
148-
/export interface Client \{(\n|.)*listPets: \((\n|.)*args: listPetsClientArgs,(\n|.)*options\?: RequestInit,(\n|.)*\) => Promise<listPetsResponseBody>;(\n|.)*\}/
148+
/export interface Client \{(\n|.)*listPets: \((\n|.)*args\?: listPetsClientArgs,(\n|.)*options\?: RequestInit,(\n|.)*\) => Promise<listPetsResponseBody>;(\n|.)*\}/
149149
);
150150
});
151151

@@ -163,7 +163,7 @@ describe("emitter-fetch-client", () => {
163163
assert.match(contents, /export type getPetParams = \{ petId: string \};/);
164164
assert.match(
165165
contents,
166-
/export type getPetResponseBody = \{ pet: Pet \} \| \{ error: NotFoundError \};/
166+
/export type getPetResponseBody =\n\s+\| { data: { pet: PetFromOperation }; statusCode: 200 }\n\s+\| { data: { error: NotFoundErrorFromOperation }; statusCode: 200 };/
167167
);
168168
});
169169

@@ -192,7 +192,7 @@ describe("emitter-fetch-client", () => {
192192
assert.match(contents, /export type createPetBody = Pet;/);
193193
assert.match(
194194
contents,
195-
/export type createPetResponseBody = \{ pet: Pet \};/
195+
/export type createPetResponseBody = {\n\s+data: { pet: PetFromOperation };\n\s+statusCode: 200;\n\s+};/
196196
);
197197
});
198198

@@ -231,7 +231,7 @@ describe("emitter-fetch-client", () => {
231231
);
232232
assert.match(
233233
contents,
234-
/export type updatePetResponseBody = \{ pet: Pet \} \| \{ error: NotFoundError \};/
234+
/export type updatePetResponseBody =\n\s+\| { data: { pet: PetFromOperation }; statusCode: 200 }\n\s+\| { data: { error: NotFoundErrorFromOperation }; statusCode: 200 };/
235235
);
236236
});
237237

@@ -266,14 +266,14 @@ describe("emitter-fetch-client", () => {
266266
);
267267
assert.match(
268268
contents,
269-
/export namespace Animals \{(\n|.)*export type listPetsResponseBody = { pets: Pet\[\] };(\n|.)*\}/
269+
/export namespace Animals \{(\n|.)*export type listPetsResponseBody = {\n\s+data: { pets: PetFromOperation\[\] };\n\s+statusCode: 200;\n\s+};(\n|.)*\}/
270270
);
271271
});
272272

273273
it("emits the handler type", () => {
274274
assert.match(
275275
contents,
276-
/export namespace Animals \{(\n|.)*listPets: ((\n|.)*args: listPetsClientArgs,(\n|.)*options\?: RequestInit,(\n|.)*) => Promise<listPetsResponseBody>;(\n|.)*\}/
276+
/export namespace Animals \{(\n|.)*listPets: ((\n|.)*args\?: listPetsClientArgs,(\n|.)*options\?: RequestInit,(\n|.)*) => Promise<listPetsResponseBody>;(\n|.)*\}/
277277
);
278278
});
279279

@@ -287,7 +287,7 @@ describe("emitter-fetch-client", () => {
287287
it("emits the route callback type", () => {
288288
assert.match(
289289
contents,
290-
/export namespace Animals \{(\n|.)*export interface Client \{(\n|.)*listPets: \((\n|.)*args: listPetsClientArgs,(\n|.)*options\?: RequestInit,(\n|.)*\) => Promise<listPetsResponseBody>;(\n|.)*\}/
290+
/export namespace Animals \{(\n|.)*export interface Client \{(\n|.)*listPets: \((\n|.)*args\?: listPetsClientArgs,(\n|.)*options\?: RequestInit,(\n|.)*\) => Promise<listPetsResponseBody>;(\n|.)*\}/
291291
);
292292
});
293293

0 commit comments

Comments
 (0)