Skip to content

Commit 5129957

Browse files
arbrandesclaude
andcommitted
test: limit ts-jest diagnostics to test files
Type errors in transformed dependencies (e.g. @edx/frontend-component-header, included via transformIgnorePatterns) were failing fresh-cache CI runs while passing locally due to ts-jest cache. Restrict diagnostics to test files only. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 05c3838 commit 5129957

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

jest.config.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const { createConfig } = require('@openedx/frontend-build');
22

3-
module.exports = createConfig('jest', {
3+
const mergedConfig = createConfig('jest', {
44
// setupFilesAfterEnv is used after the jest environment has been loaded. In general this is what you want.
55
// If you want to add config BEFORE jest loads, use setupFiles instead.
66
setupFilesAfterEnv: [
@@ -16,4 +16,17 @@ module.exports = createConfig('jest', {
1616
}
1717
});
1818

19+
// Limit ts-jest diagnostics to test files so type errors in transformed
20+
// dependencies (included via transformIgnorePatterns) don't fail the run.
21+
mergedConfig.transform['^.+\\.[tj]sx?$'] = [
22+
'ts-jest',
23+
{
24+
diagnostics: {
25+
exclude: ['!**/*.test.*'],
26+
},
27+
},
28+
];
29+
30+
module.exports = mergedConfig;
31+
1932
export {};

0 commit comments

Comments
 (0)