Skip to content

Commit 15e46b2

Browse files
committed
fix(test): ignore node_modules type diagnostics in ts-jest
Removing patch-package (which rewrote ali-oss's process.browser) made ts-jest type-check ali-oss's bundled .ts source and fail with TS2339, breaking npm test on all CI platforms. transformIgnorePatterns does not exclude node_modules, so ts-jest compiles the imported .ts. Scope ts-jest diagnostics to exclude node_modules, keeping type-checking for our own code while ignoring third-party .ts type errors. npm build and typecheck were unaffected (they resolve ali-oss's .js entry).
1 parent acd6fb3 commit 15e46b2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

jestconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"transformIgnorePatterns": ["/example/*.*"],
33
"transform": {
4-
"^.+\\.(ts|tsx)$": "ts-jest"
4+
"^.+\\.(ts|tsx)$": ["ts-jest", { "diagnostics": { "exclude": ["**/node_modules/**"] } }]
55
},
66
"testRegex": "(/__tests__/(ut|it)/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
77
"moduleFileExtensions": ["ts", "tsx", "js", "jsx", "json", "node"],

0 commit comments

Comments
 (0)