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 () => {
16
16
'package' ,
17
17
'index.ts' ,
18
18
] ;
19
+ const dtsSrcPath = [ testSetup . testDirectory , 'src' , 'types' , 'index.d.ts' ] ;
19
20
const tsSrcPath = path . join ( testSetup . testDirectory , 'src' , 'index.ts' ) ;
20
21
21
22
// Step 1.
@@ -28,6 +29,13 @@ test('Ignores node_modules when detecting TypeScript', async () => {
28
29
await testSetup . scripts . build ( ) ;
29
30
expect ( fs . existsSync ( tsConfigPath ) ) . toBe ( false ) ;
30
31
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
+
31
39
// Step 2.
32
40
// Add TS and ensure tsconfig.json is generated
33
41
fs . writeFileSync ( tsSrcPath ) ;
You can’t perform that action at this time.
0 commit comments