diff --git a/tests/specs/parse-tsconfig/extends/merges.spec.ts b/tests/specs/parse-tsconfig/extends/merges.spec.ts index 9e69ace..2338823 100644 --- a/tests/specs/parse-tsconfig/extends/merges.spec.ts +++ b/tests/specs/parse-tsconfig/extends/merges.spec.ts @@ -192,6 +192,34 @@ export default testSuite(({ describe }) => { expect(tsconfig).toStrictEqual(expectedTsconfig); }); + test('inherits with relative path from subdirectory', async () => { + await using fixture = await createFixture({ + configs: { + 'tsconfig.base.json': createTsconfigJson({ + include: ['../src-a/*'], + }), + }, + 'src-a': { + 'a.ts': '', + 'b.ts': '', + 'c.ts': '', + }, + 'tsconfig.json': createTsconfigJson({ + extends: './configs/tsconfig.base.json', + }), + }); + + const expectedTsconfig = await getTscTsconfig(fixture.path); + delete expectedTsconfig.files; + + const tsconfig = parseTsconfig(path.join(fixture.path, 'tsconfig.json')); + + expect({ + ...tsconfig, + include: tsconfig.include?.map(includePath => `configs/../${includePath}`), + }).toStrictEqual(expectedTsconfig); + }); + test('gets overwritten', async () => { await using fixture = await createFixture({ 'src-a': {