Skip to content

Commit 7bef279

Browse files
committed
fix: fix typescript compile error when import modules from src/ to run test case
1 parent 04988de commit 7bef279

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/built-in-plugins/command-test/plugin/run-test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ export const runTest = async () => {
99
execSync(
1010
[
1111
findNearestNodemodulesFile('/.bin/jest'),
12+
`--roots "${pri.sourceRoot}"`,
1213
`--testRegex "${path.join(pri.sourceRoot, testsPath.dir)}/.*\\.tsx?$"`,
1314
'--moduleFileExtensions ts tsx js jsx',
1415
`--transform '${JSON.stringify({
15-
[`${path.join(pri.sourceRoot, testsPath.dir)}/.*\\.tsx?$`]: path.join(__dirname, './jest-transformer'),
16+
[`${pri.sourceRoot}/.*\\.tsx?$`]: path.join(__dirname, './jest-transformer'),
1617
})}'`,
1718
// `--setupFilesAfterEnv '${path.join(__dirname, './jest-setup')}'`,
1819
'--coverage',

0 commit comments

Comments
 (0)