Files
frontend-app-learning/jest.config.js
Awais Ansari 0664dc38d9 feat: decouple notifications panel using widget registry mechanism (#1885)
Removes the tightly coupled upgrade/upsell ("notifications") panel from the Learning MFE core and replaces it with a pluggable widget registry system. The right sidebar now supports dynamically-registered external widgets, making it easy to add, remove, or replace sidebar panels without forking the MFE.
2026-04-08 20:03:55 -03:00

40 lines
1.6 KiB
JavaScript

const { createConfig } = require('@openedx/frontend-build');
const config = createConfig('jest', {
setupFilesAfterEnv: [
'<rootDir>/src/setupTest.js',
],
coveragePathIgnorePatterns: [
'src/setupTest.js',
'src/i18n',
'src/.*\\.exp\\..*',
],
moduleNameMapper: {
// See https://stackoverflow.com/questions/72382316/jest-encountered-an-unexpected-token-react-markdown
'react-markdown': '<rootDir>/node_modules/react-markdown/react-markdown.min.js',
'@src/(.*)': '<rootDir>/src/$1',
// Explicit mapping to ensure Jest resolves the module correctly
'@edx/frontend-lib-special-exams': '<rootDir>/node_modules/@edx/frontend-lib-special-exams',
},
testTimeout: 30000,
globalSetup: "./global-setup.js",
verbose: true,
testEnvironment: 'jsdom',
});
// delete config.testURL;
// NOTE: jest-console-group-reporter@1.1.1 uses @jest/reporters@^30 internally
// (via its peer dep resolution) but this project runs Jest 29, whose globalConfig
// uses testPathPattern (string) not testPathPatterns (object). When any worker
// exits uncleanly the reporter's SummaryReporter.onRunComplete crashes with
// "Cannot read properties of undefined (reading 'isSet')", causing a non-zero
// exit code even when all tests pass. Disabled until the package is updated for
// Jest 29/30 compatibility.
// config.reporters = [...(config.reporters || []), ["jest-console-group-reporter", {
// afterEachTest: { enable: true, filePaths: false, reportType: "details" },
// afterAllTests: { reportType: "summary", enable: true, filePaths: true },
// }]];
module.exports = config;