File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
apps/meteor/app/api/server Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -59,3 +59,25 @@ describe('ExtractRoutesFromAPI', () => {
5959 true as ExpectedFunctionSignature ;
6060 } ) ;
6161} ) ;
62+
63+ it ( 'Should extract correct function signature when multi paths is present' , ( ) => {
64+ type APIWithMultiPath = APIClass <
65+ '/v1' ,
66+ {
67+ method : 'POST' ;
68+ path : [ '/v1/endpoint.foo' , '/v1/endpoint.bar' ] ;
69+ body : ValidateFunction < {
70+ foo : string ;
71+ } > ;
72+ response : {
73+ 200 : ValidateFunction < {
74+ bar : string ;
75+ } > ;
76+ } ;
77+ authRequired : true ;
78+ }
79+ > ;
80+ type APIEndpoints = ExtractRoutesFromAPI < APIWithMultiPath > [ '/v1/endpoint.test' ] [ 'POST' ] ;
81+ type ExpectedFunctionSignature = Expect < ShallowEqual < APIEndpoints , ( params : { foo : string } ) => { bar : string } > > ;
82+ true satisfies ExpectedFunctionSignature ;
83+ } ) ;
You can’t perform that action at this time.
0 commit comments