File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
test/fixtures/issue-5947-not-typescript Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ test('Ignores node_modules when detecting TypeScript', async () => {
1616 'package' ,
1717 'index.ts' ,
1818 ] ;
19+ const dtsSrcPath = [ testSetup . testDirectory , 'src' , 'types' , 'index.d.ts' ] ;
1920 const tsSrcPath = path . join ( testSetup . testDirectory , 'src' , 'index.ts' ) ;
2021
2122 // Step 1.
@@ -28,6 +29,13 @@ test('Ignores node_modules when detecting TypeScript', async () => {
2829 await testSetup . scripts . build ( ) ;
2930 expect ( fs . existsSync ( tsConfigPath ) ) . toBe ( false ) ;
3031
32+ // Step 1b.
33+ // See if src/types/index.d.ts is treated as a JS project
34+ fs . mkdirSync ( path . join ( ...dtsSrcPath . slice ( 0 , 3 ) ) ) ;
35+ fs . writeFileSync ( path . join ( ...dtsSrcPath ) ) ;
36+ await testSetup . scripts . build ( ) ;
37+ expect ( fs . existsSync ( tsConfigPath ) ) . toBe ( false ) ;
38+
3139 // Step 2.
3240 // Add TS and ensure tsconfig.json is generated
3341 fs . writeFileSync ( tsSrcPath ) ;
You can’t perform that action at this time.
0 commit comments