Skip to content

Commit 4a6451e

Browse files
committed
feat: adds a slightly more e2e test
1 parent f05f7ea commit 4a6451e

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

app-config-config/src/index.test.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,32 @@ describe('Configuration Loading', () => {
219219
},
220220
);
221221
});
222+
223+
it('extends from another file with different environment', async () => {
224+
await withTempFiles(
225+
{
226+
'.app-config.yml': `
227+
$extends:
228+
path: ./other-file.yml
229+
env: production
230+
bar:
231+
$envVar: APP_CONFIG_ENV
232+
`,
233+
'other-file.yml': `
234+
foo:
235+
$env:
236+
default: default
237+
prod: production
238+
`,
239+
},
240+
async (inDir) => {
241+
expect((await loadUnvalidatedConfig({ directory: inDir('.'), environmentOverride: 'test' })).fullConfig).toEqual({
242+
foo: 'production',
243+
bar: 'test',
244+
});
245+
},
246+
);
247+
});
222248
});
223249

224250
describe('Configuration Loading Options', () => {

0 commit comments

Comments
 (0)