Skip to content

Commit 80563bf

Browse files
authored
[test] allow tsconfig.test.json for testing (#83137)
Adding tsconfig.json to e2e test required `.gitignore` with `!tsconfig.json`. It also lost the test utils aliases like `e2e-utils`. This PR allows adding `tsconfig.test.json` to be used on test, so it doesn't affect the root tsconfig.json nor manual testing.
1 parent 3f122a4 commit 80563bf

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/lib/next-modes/base.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,19 @@ export class NextInstance {
332332
)
333333
}
334334

335+
const tsConfigTestFile = testDirFiles.find(
336+
(file) => file === 'tsconfig.test.json'
337+
)
338+
if (tsConfigTestFile) {
339+
require('console').log(
340+
'tsconfig.test.json found, using it for this test'
341+
)
342+
await fs.copyFile(
343+
path.join(this.testDir, 'tsconfig.test.json'),
344+
path.join(this.testDir, 'tsconfig.json')
345+
)
346+
}
347+
335348
if (isNextDeploy) {
336349
const fileName = path.join(
337350
this.testDir,

0 commit comments

Comments
 (0)