@@ -6,6 +6,7 @@ import type {
6
6
ConfigEnvDefinition ,
7
7
PublicConfigsDefinitions ,
8
8
InferLoadedConfig ,
9
+ ArgsOfConfigsResolvers ,
9
10
} from '../config.types.js' ;
10
11
11
12
describe ( 'ConfigEnvDefinition' , ( ) => {
@@ -246,8 +247,8 @@ describe('InferLoadedConfig', () => {
246
247
API_PORT : ConfigAsyncResolverDefinition < undefined , number , 'request' > ;
247
248
} > ;
248
249
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 > ;
251
252
} > ( ) ;
252
253
} ) ;
253
254
@@ -265,6 +266,36 @@ describe('InferLoadedConfig', () => {
265
266
} ) ;
266
267
} ) ;
267
268
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
+
268
299
describe ( 'PublicConfigsDefinitions' , ( ) => {
269
300
it ( 'should have the type of an enum with the keys of the config definitions that have isPublic true' , ( ) => {
270
301
type PublicConfigs = PublicConfigsDefinitions < {
0 commit comments