From c96a24a1fecb30b58df1b92d2234bb9892491aa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Gonz=C3=A1lez?= Date: Sat, 22 Nov 2025 14:19:04 -0600 Subject: [PATCH] complex query param documentation + tests --- .gitignore | 2 + README.md | 4 + .../src/endpoints/complex-get.endpoint.ts | 14 + .../test-app-express-cjs/test/app.e2e-spec.ts | 414 +++++++++--------- .../test-app-express-cjs/test/create-app.ts | 5 +- .../test-app-express-esm/test/create-app.ts | 5 +- .../test/test-app-fastify-cjs/package.json | 2 + .../test-app-fastify-cjs/test/create-app.ts | 5 +- .../test/test-app-fastify-esm/package.json | 2 + .../test-app-fastify-esm/test/create-app.ts | 5 +- pnpm-lock.yaml | 46 +- scripts/test.sh | 3 + 12 files changed, 277 insertions(+), 230 deletions(-) create mode 100644 packages/test/test-app-express-cjs/src/endpoints/complex-get.endpoint.ts diff --git a/.gitignore b/.gitignore index 5336714..a1de3d2 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ openapi.json !packages/test/test-app-express-cjs/**/*.e2e-spec.ts generated/ !packages/test/test-app-express-cjs/generated +packages/test/test-app-express-esm/test/create-app.ts +packages/test/test-app-fastify-esm/test/create-app.ts diff --git a/README.md b/README.md index 1a333a0..dd44794 100644 --- a/README.md +++ b/README.md @@ -139,6 +139,10 @@ export class AppModule {} Endpoint available at `/status/health`. +### Complex query parameters + +When declaring GET endpoints with complex query parameters (zod input schema with nested object properties), you must additionally [configure](https://docs.nestjs.com/controllers#query-parameters) the Express or Fastify NestJS adapters accordingly. + ## Usage `src/endpoints/user/find.endpoint.ts` diff --git a/packages/test/test-app-express-cjs/src/endpoints/complex-get.endpoint.ts b/packages/test/test-app-express-cjs/src/endpoints/complex-get.endpoint.ts new file mode 100644 index 0000000..6b399d4 --- /dev/null +++ b/packages/test/test-app-express-cjs/src/endpoints/complex-get.endpoint.ts @@ -0,0 +1,14 @@ +import { endpoint, z } from 'nestjs-endpoints'; + +export default endpoint({ + input: z.object({ + add: z.object({ + a: z.coerce.number(), + b: z.coerce.number(), + }), + }), + output: z.number(), + handler: ({ input }) => { + return input.add.a + input.add.b; + }, +}); diff --git a/packages/test/test-app-express-cjs/test/app.e2e-spec.ts b/packages/test/test-app-express-cjs/test/app.e2e-spec.ts index 5f301a8..b9874c9 100644 --- a/packages/test/test-app-express-cjs/test/app.e2e-spec.ts +++ b/packages/test/test-app-express-cjs/test/app.e2e-spec.ts @@ -14,7 +14,7 @@ import { AppointmentRepository } from '../src/endpoints/user/appointment/appoint import { UserService } from '../src/endpoints/user/user.service'; import { createApp } from './create-app'; -describe('api', () => { +describe('api', { concurrent: true }, () => { async function setup() { const validationExceptionSpy = vitest.fn(); const serializationExceptionSpy = vitest.fn(); @@ -69,7 +69,7 @@ describe('api', () => { }; } - test.concurrent('error endpoint throws', async () => { + test('error endpoint throws', async () => { const { req, validationExceptionSpy, serializationExceptionSpy } = await setup(); await req.get('/test/error').expect(500, { @@ -80,7 +80,7 @@ describe('api', () => { expect(serializationExceptionSpy).toHaveBeenCalledTimes(0); }); - test.concurrent('user get inexistent user returns 404', async () => { + test('user get inexistent user returns 404', async () => { const { req } = await setup(); await req.get('/user/get?id=1').expect(404, { statusCode: 404, @@ -89,7 +89,7 @@ describe('api', () => { }); }); - test.concurrent('user find input validation throws', async () => { + test('user find input validation throws', async () => { const { req, validationExceptionSpy, serializationExceptionSpy } = await setup(); validationExceptionSpy.mockImplementationOnce((exception) => { @@ -122,16 +122,19 @@ describe('api', () => { expect(serializationExceptionSpy).toHaveBeenCalledTimes(0); }); - test.concurrent('user find can return null value', async () => { + test('user find can return null value', async () => { const { req, httpAdapter } = await setup(); // await req.get('/user/find?id=1').expect(200, null); // http://github.com/nestjs/nest/issues/10415 await req .get('/user/find?id=1') - .expect(200, httpAdapter === 'express' ? '' : null); + .expect(200) + .then((resp) => { + expect(resp.body).toBe(httpAdapter === 'express' ? '' : null); + }); }); - test.concurrent('can return created user', async () => { + test('can return created user', async () => { const { req } = await setup(); await req .post('/user/create') @@ -144,7 +147,7 @@ describe('api', () => { }); }); - test.concurrent('user create input validation throws', async () => { + test('user create input validation throws', async () => { const { req, validationExceptionSpy, serializationExceptionSpy } = await setup(); await req @@ -166,43 +169,40 @@ describe('api', () => { expect(serializationExceptionSpy).toHaveBeenCalledTimes(0); }); - test.concurrent( - 'user find output validation throws ZodSerializationException', - async () => { - const { - req, - userService, - validationExceptionSpy, - serializationExceptionSpy, - } = await setup(); - vitest.spyOn(userService, 'find').mockReturnValueOnce({ - id: 1, - namez: 'John', - email: 'john@example.com', - } as any); - let exception: any; - serializationExceptionSpy.mockImplementation((_exception) => { - exception = _exception; - }); - await req.get('/user/find?id=1').expect(500); - expect(validationExceptionSpy).toHaveBeenCalledTimes(0); - expect(serializationExceptionSpy).toHaveBeenCalledTimes(1); - expect(exception).toBeInstanceOf(ZodSerializationException); - expect(exception.message).toBe('Internal Server Error'); - expect( - (exception as ZodSerializationException).getZodError().issues, - ).toMatchObject([ - { - expected: 'string', - code: 'invalid_type', - path: ['name'], - message: 'Invalid input: expected string, received undefined', - }, - ]); - }, - ); + test('user find output validation throws ZodSerializationException', async () => { + const { + req, + userService, + validationExceptionSpy, + serializationExceptionSpy, + } = await setup(); + vitest.spyOn(userService, 'find').mockReturnValueOnce({ + id: 1, + namez: 'John', + email: 'john@example.com', + } as any); + let exception: any; + serializationExceptionSpy.mockImplementation((_exception) => { + exception = _exception; + }); + await req.get('/user/find?id=1').expect(500); + expect(validationExceptionSpy).toHaveBeenCalledTimes(0); + expect(serializationExceptionSpy).toHaveBeenCalledTimes(1); + expect(exception).toBeInstanceOf(ZodSerializationException); + expect(exception.message).toBe('Internal Server Error'); + expect( + (exception as ZodSerializationException).getZodError().issues, + ).toMatchObject([ + { + expected: 'string', + code: 'invalid_type', + path: ['name'], + message: 'Invalid input: expected string, received undefined', + }, + ]); + }); - test.concurrent('appointment create requires auth', async () => { + test('appointment create requires auth', async () => { const { req } = await setup(); await req .post('/user/appointment/create') @@ -213,174 +213,159 @@ describe('api', () => { .expect(401); }); - test.concurrent( - 'appointment create input validation throws', - async () => { - const { req, validationExceptionSpy, serializationExceptionSpy } = - await setup(); - await req - .post('/user/appointment/create') - .set('Authorization', 'secret') - .send({ - userId: 1, - }) - .expect(400, { - statusCode: 400, - message: 'Validation failed', - errors: [ - { - expected: 'date', - code: 'invalid_type', - received: 'Invalid Date', - path: ['date'], - message: 'Invalid input: expected date, received Date', - }, - ], - }); - expect(validationExceptionSpy).toHaveBeenCalledTimes(1); - expect(serializationExceptionSpy).toHaveBeenCalledTimes(0); - }, - ); + test('appointment create input validation throws', async () => { + const { req, validationExceptionSpy, serializationExceptionSpy } = + await setup(); + await req + .post('/user/appointment/create') + .set('Authorization', 'secret') + .send({ + userId: 1, + }) + .expect(400, { + statusCode: 400, + message: 'Validation failed', + errors: [ + { + expected: 'date', + code: 'invalid_type', + received: 'Invalid Date', + path: ['date'], + message: 'Invalid input: expected date, received Date', + }, + ], + }); + expect(validationExceptionSpy).toHaveBeenCalledTimes(1); + expect(serializationExceptionSpy).toHaveBeenCalledTimes(0); + }); - test.concurrent( - 'appointment create can return 400 with first schema of union', - async () => { - const { req, validationExceptionSpy, serializationExceptionSpy } = - await setup(); - const date1 = new Date(); - await req - .post('/user/appointment/create') - .set('Authorization', 'secret') - .send({ - userId: 2, - date: date1.toISOString(), - }) - .expect(400, 'User not found'); - expect(validationExceptionSpy).toHaveBeenCalledTimes(0); - expect(serializationExceptionSpy).toHaveBeenCalledTimes(0); - }, - ); + test('appointment create can return 400 with first schema of union', async () => { + const { req, validationExceptionSpy, serializationExceptionSpy } = + await setup(); + const date1 = new Date(); + await req + .post('/user/appointment/create') + .set('Authorization', 'secret') + .send({ + userId: 2, + date: date1.toISOString(), + }) + .expect(400, 'User not found'); + expect(validationExceptionSpy).toHaveBeenCalledTimes(0); + expect(serializationExceptionSpy).toHaveBeenCalledTimes(0); + }); - test.concurrent( - 'appointment create can return 200 with only schema', - async () => { - const { req } = await setup(); - await req - .post('/user/create') - .send({ - name: 'John', - email: 'john@example.com', - }) - .expect(200); - const date = new Date(2025, 3, 7); - const data = await req - .post('/user/appointment/create') - .set('Authorization', 'secret') - .send({ - userId: 1, - date: date.toISOString(), - }) - .expect(201); - expect(data.body).toMatchObject({ - id: 1, + test('appointment create can return 200 with only schema', async () => { + const { req } = await setup(); + await req + .post('/user/create') + .send({ + name: 'John', + email: 'john@example.com', + }) + .expect(200); + const date = new Date(2025, 3, 7); + const data = await req + .post('/user/appointment/create') + .set('Authorization', 'secret') + .send({ + userId: 1, date: date.toISOString(), - address: expect.stringContaining('127.0.0.1'), - }); - }, - ); + }) + .expect(201); + expect(data.body).toMatchObject({ + id: 1, + date: date.toISOString(), + address: expect.stringContaining('127.0.0.1'), + }); + }); - test.concurrent( - 'appointment create can return 400 with second schema of union', - async () => { - const { req, validationExceptionSpy, serializationExceptionSpy } = - await setup(); - await req - .post('/user/create') - .send({ - name: 'John', - email: 'john@example.com', - }) - .expect(200); - const date = new Date(2025, 3, 7); - await req - .post('/user/appointment/create') - .set('Authorization', 'secret') - .send({ - userId: 1, - date: date.toISOString(), - }) - .expect(201); - await req - .post('/user/appointment/create') - .set('Authorization', 'secret') - .send({ - userId: 1, - date: date.toISOString(), - }) - .expect(400, { - message: 'Appointment has conflict', - errorCode: 'APPOINTMENT_CONFLICT', - }); - expect(validationExceptionSpy).toHaveBeenCalledTimes(0); - expect(serializationExceptionSpy).toHaveBeenCalledTimes(0); - }, - ); + test('appointment create can return 400 with second schema of union', async () => { + const { req, validationExceptionSpy, serializationExceptionSpy } = + await setup(); + await req + .post('/user/create') + .send({ + name: 'John', + email: 'john@example.com', + }) + .expect(200); + const date = new Date(2025, 3, 7); + await req + .post('/user/appointment/create') + .set('Authorization', 'secret') + .send({ + userId: 1, + date: date.toISOString(), + }) + .expect(201); + await req + .post('/user/appointment/create') + .set('Authorization', 'secret') + .send({ + userId: 1, + date: date.toISOString(), + }) + .expect(400, { + message: 'Appointment has conflict', + errorCode: 'APPOINTMENT_CONFLICT', + }); + expect(validationExceptionSpy).toHaveBeenCalledTimes(0); + expect(serializationExceptionSpy).toHaveBeenCalledTimes(0); + }); - test.concurrent( - 'appointment create output validation throws ZodSerializationException', - async () => { - const { - req, - appointmentsRepository, - validationExceptionSpy, - serializationExceptionSpy, - } = await setup(); - await req - .post('/user/create') - .send({ - name: 'John', - email: 'john@example.com', - }) - .expect(200); - const date = new Date(); - vitest.spyOn(appointmentsRepository, 'create').mockReturnValueOnce({ - id: 1, + test('appointment create output validation throws ZodSerializationException', async () => { + const { + req, + appointmentsRepository, + validationExceptionSpy, + serializationExceptionSpy, + } = await setup(); + await req + .post('/user/create') + .send({ + name: 'John', + email: 'john@example.com', + }) + .expect(200); + const date = new Date(); + vitest.spyOn(appointmentsRepository, 'create').mockReturnValueOnce({ + id: 1, + userId: 1, + date: date.toISOString(), // should fail since zod output schema expects a Date + address: '127.0.0.1', + } as any); + let exception: any; + serializationExceptionSpy.mockImplementationOnce((_exception) => { + exception = _exception; + }); + await req + .post('/user/appointment/create') + .set('Authorization', 'secret') + .send({ userId: 1, - date: date.toISOString(), // should fail since zod output schema expects a Date - address: '127.0.0.1', - } as any); - let exception: any; - serializationExceptionSpy.mockImplementationOnce((_exception) => { - exception = _exception; + date: date.toISOString(), + }) + .expect(500, { + statusCode: 500, + message: 'Internal Server Error', }); - await req - .post('/user/appointment/create') - .set('Authorization', 'secret') - .send({ - userId: 1, - date: date.toISOString(), - }) - .expect(500, { - statusCode: 500, - message: 'Internal Server Error', - }); - expect(validationExceptionSpy).toHaveBeenCalledTimes(0); - expect(serializationExceptionSpy).toHaveBeenCalledTimes(1); - expect(exception).toBeInstanceOf(ZodSerializationException); - expect( - (exception as ZodSerializationException).getZodError().issues, - ).toMatchObject([ - { - expected: 'date', - code: 'invalid_type', - path: ['date'], - message: 'Invalid input: expected date, received string', - }, - ]); - }, - ); + expect(validationExceptionSpy).toHaveBeenCalledTimes(0); + expect(serializationExceptionSpy).toHaveBeenCalledTimes(1); + expect(exception).toBeInstanceOf(ZodSerializationException); + expect( + (exception as ZodSerializationException).getZodError().issues, + ).toMatchObject([ + { + expected: 'date', + code: 'invalid_type', + path: ['date'], + message: 'Invalid input: expected date, received string', + }, + ]); + }); - test.concurrent('appointment count returns number', async () => { + test('appointment count returns number', async () => { const { req } = await setup(); await req .get('/user/appointment/count?userId=1') @@ -413,7 +398,7 @@ describe('api', () => { }); }); - test.concurrent('can access input schema in handler', async () => { + test('can access input schema in handler', async () => { const { req } = await setup(); await req .post('/user/create') @@ -431,7 +416,7 @@ describe('api', () => { }); }); - test.concurrent('can override a provider', async () => { + test('can override a provider', async () => { const moduleFixture: TestingModule = await Test.createTestingModule({ imports: [AppModule], }) @@ -463,7 +448,7 @@ describe('api', () => { }); }); - test.concurrent('can access auth endpoints', async () => { + test('can access auth endpoints', async () => { const { req } = await setup(); await req .post('/auth/login') @@ -479,7 +464,7 @@ describe('api', () => { }); }); - test.concurrent('greet endpoint returns greeting', async () => { + test('greet endpoint returns greeting', async () => { const { req } = await setup(); await req .get('/greet') @@ -487,7 +472,7 @@ describe('api', () => { .expect(200, 'Hello, John!'); }); - test.concurrent('greet endpoint input validation throws', async () => { + test('greet endpoint input validation throws', async () => { const { req, validationExceptionSpy, serializationExceptionSpy } = await setup(); await req @@ -508,6 +493,17 @@ describe('api', () => { expect(validationExceptionSpy).toHaveBeenCalledTimes(1); expect(serializationExceptionSpy).toHaveBeenCalledTimes(0); }); + + test('complex query parameters work', async () => { + const { req } = await setup(); + await req + .get('/complex-get') + .query({ 'add[a]': 5, 'add[b]': 7 }) + .expect(200) + .then((resp) => { + expect(resp.body).toBe(12); + }); + }); }); test('spec works', async () => { diff --git a/packages/test/test-app-express-cjs/test/create-app.ts b/packages/test/test-app-express-cjs/test/create-app.ts index f2d5baa..f4bd5c0 100644 --- a/packages/test/test-app-express-cjs/test/create-app.ts +++ b/packages/test/test-app-express-cjs/test/create-app.ts @@ -1,7 +1,10 @@ +import type { NestExpressApplication } from '@nestjs/platform-express'; import type { TestingModule } from '@nestjs/testing'; export async function createApp(moduleFixture: TestingModule) { - const app = moduleFixture.createNestApplication(); + const app = + moduleFixture.createNestApplication(); + app.set('query parser', 'extended'); await app.init(); await app.listen(0); return { app, httpAdapter: 'express' }; diff --git a/packages/test/test-app-express-esm/test/create-app.ts b/packages/test/test-app-express-esm/test/create-app.ts index f2d5baa..f4bd5c0 100644 --- a/packages/test/test-app-express-esm/test/create-app.ts +++ b/packages/test/test-app-express-esm/test/create-app.ts @@ -1,7 +1,10 @@ +import type { NestExpressApplication } from '@nestjs/platform-express'; import type { TestingModule } from '@nestjs/testing'; export async function createApp(moduleFixture: TestingModule) { - const app = moduleFixture.createNestApplication(); + const app = + moduleFixture.createNestApplication(); + app.set('query parser', 'extended'); await app.init(); await app.listen(0); return { app, httpAdapter: 'express' }; diff --git a/packages/test/test-app-fastify-cjs/package.json b/packages/test/test-app-fastify-cjs/package.json index abc408e..fe90c06 100644 --- a/packages/test/test-app-fastify-cjs/package.json +++ b/packages/test/test-app-fastify-cjs/package.json @@ -22,6 +22,7 @@ "@tanstack/react-query": "^5.71.10", "@types/react": "^19.1.0", "nestjs-endpoints": "workspace:*", + "qs": "^6.14.0", "react": "^19.1.0", "rxjs": "^7.8.1", "tsx": "^4.19.3", @@ -32,6 +33,7 @@ "@nestjs/schematics": "^11.0.3", "@nestjs/testing": "^11.0.13", "@types/node": "^20.3.1", + "@types/qs": "^6.14.0", "@types/supertest": "^2.0.12", "axios": "^1.7.9", "orval": "~7.8.0", diff --git a/packages/test/test-app-fastify-cjs/test/create-app.ts b/packages/test/test-app-fastify-cjs/test/create-app.ts index a084bda..6b5542f 100644 --- a/packages/test/test-app-fastify-cjs/test/create-app.ts +++ b/packages/test/test-app-fastify-cjs/test/create-app.ts @@ -3,10 +3,13 @@ import { NestFastifyApplication, } from '@nestjs/platform-fastify'; import type { TestingModule } from '@nestjs/testing'; +import qs from 'qs'; export async function createApp(moduleFixture: TestingModule) { const app = moduleFixture.createNestApplication( - new FastifyAdapter(), + new FastifyAdapter({ + querystringParser: (str) => qs.parse(str), + }), ); await app.init(); await app.listen(0); diff --git a/packages/test/test-app-fastify-esm/package.json b/packages/test/test-app-fastify-esm/package.json index 095ac11..845d7e8 100644 --- a/packages/test/test-app-fastify-esm/package.json +++ b/packages/test/test-app-fastify-esm/package.json @@ -17,6 +17,7 @@ "@tanstack/react-query": "^5.71.10", "@types/react": "^19.1.0", "nestjs-endpoints": "workspace:*", + "qs": "^6.14.0", "react": "^19.1.0", "rxjs": "^7.8.1", "tsx": "^4.19.3", @@ -27,6 +28,7 @@ "@nestjs/schematics": "^11.0.3", "@nestjs/testing": "^11.0.13", "@types/node": "^20.3.1", + "@types/qs": "^6.14.0", "@types/supertest": "^2.0.12", "axios": "^1.7.9", "orval": "~7.8.0", diff --git a/packages/test/test-app-fastify-esm/test/create-app.ts b/packages/test/test-app-fastify-esm/test/create-app.ts index a084bda..6b5542f 100644 --- a/packages/test/test-app-fastify-esm/test/create-app.ts +++ b/packages/test/test-app-fastify-esm/test/create-app.ts @@ -3,10 +3,13 @@ import { NestFastifyApplication, } from '@nestjs/platform-fastify'; import type { TestingModule } from '@nestjs/testing'; +import qs from 'qs'; export async function createApp(moduleFixture: TestingModule) { const app = moduleFixture.createNestApplication( - new FastifyAdapter(), + new FastifyAdapter({ + querystringParser: (str) => qs.parse(str), + }), ); await app.init(); await app.listen(0); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 60ac8f0..08311fe 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -290,6 +290,9 @@ importers: nestjs-endpoints: specifier: workspace:* version: link:../../nestjs-endpoints + qs: + specifier: ^6.14.0 + version: 6.14.0 react: specifier: ^19.1.0 version: 19.1.0 @@ -315,6 +318,9 @@ importers: '@types/node': specifier: ^20.3.1 version: 20.17.17 + '@types/qs': + specifier: ^6.14.0 + version: 6.14.0 '@types/supertest': specifier: ^2.0.12 version: 2.0.16 @@ -372,6 +378,9 @@ importers: nestjs-endpoints: specifier: workspace:* version: link:../../nestjs-endpoints + qs: + specifier: ^6.14.0 + version: 6.14.0 react: specifier: ^19.1.0 version: 19.1.0 @@ -397,6 +406,9 @@ importers: '@types/node': specifier: ^20.3.1 version: 20.17.17 + '@types/qs': + specifier: ^6.14.0 + version: 6.14.0 '@types/supertest': specifier: ^2.0.12 version: 2.0.16 @@ -1967,8 +1979,8 @@ packages: '@types/node@22.13.1': resolution: {integrity: sha512-jK8uzQlrvXqEU91UxiK5J7pKHyzgnI1Qnl0QDHIgVGuolJhRb9EEl28Cj9b3rGR8B2lhFCtvIm5os8lFnO/1Ew==} - '@types/qs@6.9.18': - resolution: {integrity: sha512-kK7dgTYDyGqS+e2Q4aK9X3D7q234CIZ1Bv0q/7Z5IwRDoADNU81xXJK/YVyLbLTZCoIwUoDoffFeF+p/eIklAA==} + '@types/qs@6.14.0': + resolution: {integrity: sha512-eOunJqu0K1923aExK6y8p6fsihYEn/BYuQ4g0CxAAgFc4b/ZLN4CrsRZ55srTdqoiLzU2B2evC+apEIxprEzkQ==} '@types/range-parser@1.2.7': resolution: {integrity: sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==} @@ -6489,7 +6501,7 @@ snapshots: '@types/express-serve-static-core@5.0.6': dependencies: '@types/node': 22.13.1 - '@types/qs': 6.9.18 + '@types/qs': 6.14.0 '@types/range-parser': 1.2.7 '@types/send': 0.17.4 @@ -6497,7 +6509,7 @@ snapshots: dependencies: '@types/body-parser': 1.19.5 '@types/express-serve-static-core': 5.0.6 - '@types/qs': 6.9.18 + '@types/qs': 6.14.0 '@types/serve-static': 1.15.7 '@types/hast@3.0.4': @@ -6522,7 +6534,7 @@ snapshots: dependencies: undici-types: 6.20.0 - '@types/qs@6.9.18': {} + '@types/qs@6.14.0': {} '@types/range-parser@1.2.7': {} @@ -7402,7 +7414,7 @@ snapshots: arraybuffer.prototype.slice: 1.0.4 available-typed-arrays: 1.0.7 call-bind: 1.0.8 - call-bound: 1.0.3 + call-bound: 1.0.4 data-view-buffer: 1.0.2 data-view-byte-length: 1.0.2 data-view-byte-offset: 1.0.1 @@ -7412,7 +7424,7 @@ snapshots: es-set-tostringtag: 2.1.0 es-to-primitive: 1.3.0 function.prototype.name: 1.1.8 - get-intrinsic: 1.2.7 + get-intrinsic: 1.3.0 get-proto: 1.0.1 get-symbol-description: 1.1.0 globalthis: 1.0.4 @@ -8254,7 +8266,7 @@ snapshots: is-async-function@2.1.1: dependencies: async-function: 1.0.0 - call-bound: 1.0.3 + call-bound: 1.0.4 get-proto: 1.0.1 has-tostringtag: 1.0.2 safe-regex-test: 1.1.0 @@ -8293,7 +8305,7 @@ snapshots: is-finalizationregistry@1.1.1: dependencies: - call-bound: 1.0.3 + call-bound: 1.0.4 is-fullwidth-code-point@3.0.0: {} @@ -8305,7 +8317,7 @@ snapshots: is-generator-function@1.1.0: dependencies: - call-bound: 1.0.3 + call-bound: 1.0.4 get-proto: 1.0.1 has-tostringtag: 1.0.2 safe-regex-test: 1.1.0 @@ -8373,8 +8385,8 @@ snapshots: is-weakset@2.0.4: dependencies: - call-bound: 1.0.3 - get-intrinsic: 1.2.7 + call-bound: 1.0.4 + get-intrinsic: 1.3.0 isarray@1.0.0: {} @@ -9367,16 +9379,16 @@ snapshots: side-channel-map@1.0.1: dependencies: - call-bound: 1.0.3 + call-bound: 1.0.4 es-errors: 1.3.0 - get-intrinsic: 1.2.7 + get-intrinsic: 1.3.0 object-inspect: 1.13.4 side-channel-weakmap@1.0.2: dependencies: - call-bound: 1.0.3 + call-bound: 1.0.4 es-errors: 1.3.0 - get-intrinsic: 1.2.7 + get-intrinsic: 1.3.0 object-inspect: 1.13.4 side-channel-map: 1.0.1 @@ -10138,7 +10150,7 @@ snapshots: which-builtin-type@1.2.1: dependencies: - call-bound: 1.0.3 + call-bound: 1.0.4 function.prototype.name: 1.1.8 has-tostringtag: 1.0.2 is-async-function: 2.1.1 diff --git a/scripts/test.sh b/scripts/test.sh index 94f15c6..d3f6712 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -11,6 +11,9 @@ pnpm --filter "./packages/test/*" --filter "!test-app-express-cjs" --filter "!te rsync -ar ../test-app-express-cjs/test/ ./test/ --exclude=create-app.ts " +cp ./packages/test/test-app-express-cjs/test/create-app.ts ./packages/test/test-app-express-esm/test/create-app.ts +cp ./packages/test/test-app-fastify-cjs/test/create-app.ts ./packages/test/test-app-fastify-esm/test/create-app.ts + pnpm --filter "./packages/test/*" run codegen pnpm -r run tscheck