Skip to content

Commit c0a3604

Browse files
committed
fix(build): use testPathIgnorePatterns for dist exclusion
Move the 'dist' pattern from modulePathIgnorePatterns (which blocks module resolution) to testPathIgnorePatterns (which only affects test discovery). Disable ts-jest diagnostics since it does not support composite project references — tsc -b is the source of truth for type checking.
1 parent 9d324ac commit c0a3604

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

jest.config.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,22 @@
1818
module.exports = {
1919
preset: "ts-jest",
2020
testEnvironment: "node",
21-
modulePathIgnorePatterns: [
22-
"dist",
23-
"packages/fuzzer/build",
24-
"tests/code_coverage",
25-
],
21+
modulePathIgnorePatterns: ["packages/fuzzer/build", "tests/code_coverage"],
22+
testPathIgnorePatterns: ["/dist/", "/node_modules/"],
2623
testMatch: ["<rootDir>/packages/**/*.test.[jt]s"],
2724
collectCoverageFrom: ["packages/**/*.ts"],
2825
coveragePathIgnorePatterns: ["/node_modules/", "/dist/"],
26+
transform: {
27+
"^.+\\.tsx?$": [
28+
"ts-jest",
29+
{
30+
// ts-jest does not support composite project references.
31+
// It compiles workspace .ts sources in one flat program,
32+
// which breaks cross-package type resolution. Disabling
33+
// diagnostics lets tsc -b (which does understand project
34+
// refs) be the single source of truth for type checking.
35+
diagnostics: false,
36+
},
37+
],
38+
},
2939
};

0 commit comments

Comments
 (0)