fixed all tests
This commit is contained in:
parent
08f713d98b
commit
bd26ecf3bc
11 changed files with 457 additions and 794 deletions
|
|
@ -422,34 +422,6 @@ describe('ConfigManager', () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe('createTypedGetter', () => {
|
||||
it('should create a typed getter function', () => {
|
||||
const loader = new MockLoader({
|
||||
database: {
|
||||
host: 'localhost',
|
||||
port: 5432,
|
||||
},
|
||||
});
|
||||
|
||||
manager = new ConfigManager({ loaders: [loader] });
|
||||
manager.initialize();
|
||||
|
||||
const schema = z.object({
|
||||
database: z.object({
|
||||
host: z.string(),
|
||||
port: z.number(),
|
||||
}),
|
||||
environment: z.string(),
|
||||
});
|
||||
|
||||
const getConfig = manager.createTypedGetter(schema);
|
||||
const config = getConfig();
|
||||
|
||||
expect(config.database.host).toBe('localhost');
|
||||
expect(config.database.port).toBe(5432);
|
||||
expect(config.environment).toBe('development');
|
||||
});
|
||||
});
|
||||
|
||||
describe('deepMerge', () => {
|
||||
it('should handle circular references', () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue