File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
tests/specs/parse-tsconfig/extends Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -192,6 +192,34 @@ export default testSuite(({ describe }) => {
192192 expect ( tsconfig ) . toStrictEqual ( expectedTsconfig ) ;
193193 } ) ;
194194
195+ test ( 'inherits with relative path from subdirectory' , async ( ) => {
196+ await using fixture = await createFixture ( {
197+ configs : {
198+ 'tsconfig.base.json' : createTsconfigJson ( {
199+ include : [ '../src-a/*' ] ,
200+ } ) ,
201+ } ,
202+ 'src-a' : {
203+ 'a.ts' : '' ,
204+ 'b.ts' : '' ,
205+ 'c.ts' : '' ,
206+ } ,
207+ 'tsconfig.json' : createTsconfigJson ( {
208+ extends : './configs/tsconfig.base.json' ,
209+ } ) ,
210+ } ) ;
211+
212+ const expectedTsconfig = await getTscTsconfig ( fixture . path ) ;
213+ delete expectedTsconfig . files ;
214+
215+ const tsconfig = parseTsconfig ( path . join ( fixture . path , 'tsconfig.json' ) ) ;
216+
217+ expect ( {
218+ ...tsconfig ,
219+ include : tsconfig . include ?. map ( includePath => `configs/../${ includePath } ` ) ,
220+ } ) . toStrictEqual ( expectedTsconfig ) ;
221+ } ) ;
222+
195223 test ( 'gets overwritten' , async ( ) => {
196224 await using fixture = await createFixture ( {
197225 'src-a' : {
You can’t perform that action at this time.
0 commit comments