From e31ed7dcec6d7dd2e31a17775b57a6c77c169503 Mon Sep 17 00:00:00 2001 From: Jonathan Haines Date: Wed, 21 Feb 2024 08:27:38 +1100 Subject: [PATCH] add failing test --- .../core/__tests__/config/load-config.test.ts | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/packages/core/__tests__/config/load-config.test.ts b/packages/core/__tests__/config/load-config.test.ts index 637592949..809fad7a4 100644 --- a/packages/core/__tests__/config/load-config.test.ts +++ b/packages/core/__tests__/config/load-config.test.ts @@ -51,4 +51,39 @@ describe('Config: loadConfig', () => { expect(config.environment.getConfiguredTemplateTags()).toEqual({ test: {} }); expect(config.checkStandaloneTemplates).toBe(false); }); + + test('loads config with extends array', () => { + fs.writeFileSync( + `${testDir}/tsconfig-first.json`, + JSON.stringify({ + glint: { + environment: 'first', + checkStandaloneTemplates: false, + }, + }) + ); + + fs.writeFileSync( + `${testDir}/tsconfig-second.json`, + JSON.stringify({ + glint: { + environment: 'second', + checkStandaloneTemplates: false, + }, + }) + ); + + fs.writeFileSync( + `${testDir}/tsconfig.json`, + JSON.stringify({ + extends: ['./tsconfig-first.json', './tsconfig-second.json'], + }) + ); + + let config = loadConfig(testDir); + + expect(config.rootDir).toBe(normalizePath(`${testDir}/deeply`)); + expect(config.environment.getConfiguredTemplateTags()).toEqual({ test: {} }); + expect(config.checkStandaloneTemplates).toBe(false); + }); });