File tree Expand file tree Collapse file tree 1 file changed +21
-3
lines changed
Expand file tree Collapse file tree 1 file changed +21
-3
lines changed Original file line number Diff line number Diff line change 11const { createConfig } = require ( '@openedx/frontend-build' ) ;
22
3- module . exports = createConfig ( 'jest' , {
3+ const mergedConfig = createConfig ( 'jest' , {
44 setupFilesAfterEnv : [
55 'jest-expect-message' ,
66 '<rootDir>/src/setupTest.js' ,
@@ -16,6 +16,24 @@ module.exports = createConfig('jest', {
1616 // This alias is used for plugins in the plugins/ folder only.
1717 '^CourseAuthoring/(.*)$' : '<rootDir>/src/$1' ,
1818 } ,
19- modulePathIgnorePatterns : [
20- ] ,
19+ modulePathIgnorePatterns : [ ] ,
2120} ) ;
21+
22+ // Override ts-jest config: When transforming .ts files to .js for test purposes,
23+ // don't report TypeScript errors for files in `node_modules/` (or any non-test files).
24+ // Without this, we were seeing TypeScript errors from
25+ // node_modules/@edx /frontend-component-header/dist/studio-header/StudioHeader.tsx
26+ // cause the tests to fail, because they are included in `transformIgnorePatterns`.
27+ // -> If you can delete the following lines and the tests still pass, then feel free
28+ // to remove this whole override. It's only necessary now while StudioHeader has some
29+ // typing issues.
30+ mergedConfig . transform [ '^.+\\.[tj]sx?$' ] = [
31+ 'ts-jest' ,
32+ {
33+ diagnostics : {
34+ exclude : [ '!**/*.test.*' ] ,
35+ } ,
36+ } ,
37+ ] ;
38+
39+ module . exports = mergedConfig ;
You can’t perform that action at this time.
0 commit comments