@@ -6,6 +6,7 @@ import type {
66 ConfigEnvDefinition ,
77 PublicConfigsDefinitions ,
88 InferLoadedConfig ,
9+ ArgsOfConfigsResolvers ,
910} from '../config.types.js' ;
1011
1112describe ( 'ConfigEnvDefinition' , ( ) => {
@@ -246,8 +247,8 @@ describe('InferLoadedConfig', () => {
246247 API_PORT : ConfigAsyncResolverDefinition < undefined , number , 'request' > ;
247248 } > ;
248249 expect < LoadedConfig > ( ) . type . toBe < {
249- API_URL : ( ) => string ;
250- API_PORT : ( ) => Promise < number > ;
250+ API_URL : ( args ?: undefined ) => string ;
251+ API_PORT : ( args ?: undefined ) => Promise < number > ;
251252 } > ( ) ;
252253 } ) ;
253254
@@ -265,6 +266,36 @@ describe('InferLoadedConfig', () => {
265266 } ) ;
266267} ) ;
267268
269+ describe ( 'ArgsOfLoadedConfigsResolvers' , ( ) => {
270+ it ( 'should have the type of the args of the loaded configs resolvers' , ( ) => {
271+ type ArgsType = ArgsOfConfigsResolvers <
272+ InferLoadedConfig < {
273+ DATABASE_URL : ConfigEnvDefinition ;
274+ API_URL : ConfigSyncResolverDefinition < undefined , string , 'request' > ;
275+ API_URL_WITH_ARGS : ConfigAsyncResolverDefinition <
276+ string ,
277+ string ,
278+ 'request'
279+ > ;
280+ API_PORT : ConfigAsyncResolverDefinition < undefined , number , 'request' > ;
281+ API_PORT_WITH_ARGS : ConfigAsyncResolverDefinition <
282+ number ,
283+ number ,
284+ 'request'
285+ > ;
286+ } >
287+ > ;
288+
289+ expect < ArgsType > ( ) . type . toBe < {
290+ DATABASE_URL : undefined ;
291+ API_URL : undefined ;
292+ API_URL_WITH_ARGS : string ;
293+ API_PORT : undefined ;
294+ API_PORT_WITH_ARGS : number ;
295+ } > ( ) ;
296+ } ) ;
297+ } ) ;
298+
268299describe ( 'PublicConfigsDefinitions' , ( ) => {
269300 it ( 'should have the type of an enum with the keys of the config definitions that have isPublic true' , ( ) => {
270301 type PublicConfigs = PublicConfigsDefinitions < {
0 commit comments