Skip to content

Commit da8db47

Browse files
Copilothotlong
andauthored
fix: add missing '/api' prefix arg to dispatch assertions in adapter tests
Add the 6th 'prefix' argument ('/api') to all toHaveBeenCalledWith assertions for dispatcher.dispatch() in fastify, nextjs, and sveltekit adapter test files. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 9df9d77 commit da8db47

4 files changed

Lines changed: 20 additions & 0 deletions

File tree

packages/adapters/fastify/src/fastify.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ describe('objectStackPlugin', () => {
9696
undefined,
9797
expect.any(Object),
9898
expect.objectContaining({ request: expect.anything() }),
99+
'/api',
99100
);
100101
});
101102

@@ -112,6 +113,7 @@ describe('objectStackPlugin', () => {
112113
undefined,
113114
expect.any(Object),
114115
expect.objectContaining({ request: expect.anything() }),
116+
'/api',
115117
);
116118
});
117119

packages/adapters/nextjs/src/metadata-api.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ describe('Next.js Metadata API Integration Tests', () => {
132132
undefined,
133133
{},
134134
expect.objectContaining({ request: expect.anything() }),
135+
'/api',
135136
);
136137
});
137138
});
@@ -159,6 +160,7 @@ describe('Next.js Metadata API Integration Tests', () => {
159160
undefined,
160161
{},
161162
expect.objectContaining({ request: expect.anything() }),
163+
'/api',
162164
);
163165
});
164166
});
@@ -185,6 +187,7 @@ describe('Next.js Metadata API Integration Tests', () => {
185187
body,
186188
{},
187189
expect.objectContaining({ request: expect.anything() }),
190+
'/api',
188191
);
189192
});
190193
});
@@ -207,6 +210,7 @@ describe('Next.js Metadata API Integration Tests', () => {
207210
body,
208211
{},
209212
expect.objectContaining({ request: expect.anything() }),
213+
'/api',
210214
);
211215
});
212216
});
@@ -238,6 +242,7 @@ describe('Next.js Metadata API Integration Tests', () => {
238242
undefined,
239243
{},
240244
expect.objectContaining({ request: expect.anything() }),
245+
'/api',
241246
);
242247
});
243248

@@ -250,6 +255,7 @@ describe('Next.js Metadata API Integration Tests', () => {
250255
undefined,
251256
{},
252257
expect.objectContaining({ request: expect.anything() }),
258+
'/api',
253259
);
254260
});
255261

@@ -262,6 +268,7 @@ describe('Next.js Metadata API Integration Tests', () => {
262268
undefined,
263269
{},
264270
expect.objectContaining({ request: expect.anything() }),
271+
'/api',
265272
);
266273
});
267274
});
@@ -696,6 +703,7 @@ describe('Next.js Metadata API Integration Tests', () => {
696703
undefined,
697704
{},
698705
expect.objectContaining({ request: expect.anything() }),
706+
'/api',
699707
);
700708
});
701709

@@ -709,6 +717,7 @@ describe('Next.js Metadata API Integration Tests', () => {
709717
undefined,
710718
{},
711719
expect.objectContaining({ request: expect.anything() }),
720+
'/api',
712721
);
713722
});
714723
});

packages/adapters/nextjs/src/nextjs.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ describe('createRouteHandler', () => {
284284
undefined,
285285
expect.any(Object),
286286
expect.objectContaining({ request: expect.anything() }),
287+
'/api',
287288
);
288289
});
289290

@@ -299,6 +300,7 @@ describe('createRouteHandler', () => {
299300
body,
300301
expect.any(Object),
301302
expect.objectContaining({ request: expect.anything() }),
303+
'/api',
302304
);
303305
});
304306

@@ -314,6 +316,7 @@ describe('createRouteHandler', () => {
314316
body,
315317
expect.any(Object),
316318
expect.objectContaining({ request: expect.anything() }),
319+
'/api',
317320
);
318321
});
319322
});
@@ -330,6 +333,7 @@ describe('createRouteHandler', () => {
330333
undefined,
331334
expect.any(Object),
332335
expect.objectContaining({ request: expect.anything() }),
336+
'/api',
333337
);
334338
});
335339

@@ -345,6 +349,7 @@ describe('createRouteHandler', () => {
345349
body,
346350
expect.any(Object),
347351
expect.objectContaining({ request: expect.anything() }),
352+
'/api',
348353
);
349354
});
350355

@@ -360,6 +365,7 @@ describe('createRouteHandler', () => {
360365
body,
361366
expect.any(Object),
362367
expect.objectContaining({ request: expect.anything() }),
368+
'/api',
363369
);
364370
});
365371

packages/adapters/sveltekit/src/sveltekit.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ describe('createRequestHandler', () => {
176176
undefined,
177177
expect.any(Object),
178178
expect.objectContaining({ request: expect.anything() }),
179+
'/api',
179180
);
180181
});
181182
});
@@ -191,6 +192,7 @@ describe('createRequestHandler', () => {
191192
undefined,
192193
expect.any(Object),
193194
expect.objectContaining({ request: expect.anything() }),
195+
'/api',
194196
);
195197
});
196198

@@ -205,6 +207,7 @@ describe('createRequestHandler', () => {
205207
body,
206208
expect.any(Object),
207209
expect.objectContaining({ request: expect.anything() }),
210+
'/api',
208211
);
209212
});
210213

0 commit comments

Comments
 (0)