Skip to content

Commit a150d55

Browse files
authored
Explicitly error when an exclude is provided by a test as it will be unused (#32014)
1 parent 9bae1ed commit a150d55

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

src/testRunner/compilerRunner.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ class CompilerTest {
143143
this.tsConfigFiles = [];
144144
if (testCaseContent.tsConfig) {
145145
assert.equal(testCaseContent.tsConfig.fileNames.length, 0, `list of files in tsconfig is not currently supported`);
146+
assert.equal(testCaseContent.tsConfig.raw.exclude, undefined, `exclude in tsconfig is not currently supported`);
146147

147148
tsConfigOptions = ts.cloneCompilerOptions(testCaseContent.tsConfig.options);
148149
this.tsConfigFiles.push(this.createHarnessTestFile(testCaseContent.tsConfigFileUnitData!, rootDir, ts.combinePaths(rootDir, tsConfigOptions.configFilePath!)));

tests/baselines/reference/maxNodeModuleJsDepthDefaultsToZero.errors.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
"module": "commonjs",
99
"moduleResolution": "node",
1010
"outDir": "bin"
11-
},
12-
"exclude": [ "node_modules" ]
11+
}
1312
}
1413
==== /index.ts (1 errors) ====
1514
/// <reference path="/typings/index.d.ts" />

tests/cases/compiler/compositeWithNodeModulesSourceFile.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// @filename: /foo/tsconfig.json
22
{
3-
"compilerOptions": { "composite": true },
4-
"exclude": [ "node_modules" ]
3+
"compilerOptions": { "composite": true }
54
}
65

76
// @filename: /foo/node_modules/myModule/index.ts

tests/cases/compiler/maxNodeModuleJsDepthDefaultsToZero.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
"module": "commonjs",
1212
"moduleResolution": "node",
1313
"outDir": "bin"
14-
},
15-
"exclude": [ "node_modules" ]
14+
}
1615
}
1716
// @filename: /node_modules/shortid/node_modules/z/index.js
1817
// z will not be found because maxNodeModulesJsDepth: 0

0 commit comments

Comments
 (0)