From cb19868911075fb0a54672688a283fd2e3dd126b Mon Sep 17 00:00:00 2001 From: ahmed-n-abdeltwab Date: Mon, 11 Aug 2025 15:18:31 +0300 Subject: [PATCH] test: add the case where multi paths is present --- apps/meteor/app/api/server/ApiClass.spec.ts | 22 +++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/apps/meteor/app/api/server/ApiClass.spec.ts b/apps/meteor/app/api/server/ApiClass.spec.ts index 4edc2dd12d23c..a12cd455043b5 100644 --- a/apps/meteor/app/api/server/ApiClass.spec.ts +++ b/apps/meteor/app/api/server/ApiClass.spec.ts @@ -59,3 +59,25 @@ describe('ExtractRoutesFromAPI', () => { true as ExpectedFunctionSignature; }); }); + +it('Should extract correct function signature when multi paths is present', () => { + type APIWithMultiPath = APIClass< + '/v1', + { + method: 'POST'; + path: ['/v1/endpoint.foo', '/v1/endpoint.bar']; + body: ValidateFunction<{ + foo: string; + }>; + response: { + 200: ValidateFunction<{ + bar: string; + }>; + }; + authRequired: true; + } + >; + type APIEndpoints = ExtractRoutesFromAPI['/v1/endpoint.test']['POST']; + type ExpectedFunctionSignature = Expect { bar: string }>>; + true satisfies ExpectedFunctionSignature; +});