fix: fixed some problems with tests

This commit is contained in:
PKulkoRaccoonGang
2025-09-25 14:29:30 +03:00
committed by Adolfo R. Brandes
parent ef6c498bb7
commit b106d0694f
6 changed files with 18 additions and 11 deletions

1
package-lock.json generated
View File

@@ -42,6 +42,7 @@
"devDependencies": {
"@edx/browserslist-config": "^1.2.0",
"@edx/reactifex": "^2.1.1",
"@edx/typescript-config": "^1.1.0",
"@openedx/frontend-build": "^14.6.2",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.2.0",

View File

@@ -12,8 +12,8 @@
"scripts": {
"build": "fedx-scripts webpack",
"i18n_extract": "fedx-scripts formatjs extract",
"lint": "fedx-scripts eslint --ext .js --ext .jsx .",
"lint:fix": "fedx-scripts eslint --fix --ext .js --ext .jsx .",
"lint": "fedx-scripts eslint --ext .js --ext .jsx src/",
"lint:fix": "fedx-scripts eslint --fix --ext .js --ext .jsx src/",
"snapshot": "fedx-scripts jest --updateSnapshot",
"start": "fedx-scripts webpack-dev-server --progress",
"dev": "PUBLIC_PATH=/communications/ MFE_CONFIG_API_URL='http://localhost:8000/api/mfe_config/v1' fedx-scripts webpack-dev-server --progress --host apps.local.openedx.io",
@@ -62,6 +62,7 @@
"devDependencies": {
"@edx/browserslist-config": "^1.2.0",
"@edx/reactifex": "^2.1.1",
"@edx/typescript-config": "^1.1.0",
"@openedx/frontend-build": "^14.6.2",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.2.0",

View File

@@ -23,10 +23,6 @@ jest.mock('react-router-dom', () => ({
courseId: 'test-course-id',
})),
}));
jest.mock('@edx/frontend-component-header', () => ({
__esModule: true,
default: () => null,
}));
describe('BulkEmailTool', () => {
beforeEach(() => jest.resetModules());

View File

@@ -23,10 +23,6 @@ jest.mock('react-router-dom', () => ({
courseId: 'test-course-id',
})),
}));
jest.mock('@edx/frontend-component-header', () => ({
__esModule: true,
default: () => null,
}));
describe('PageContainer', () => {
beforeEach(() => jest.resetModules());

View File

@@ -3,7 +3,7 @@ import {
} from '@edx/frontend-platform';
// Jest needs this for module resolution
import * as app from '.'; // eslint-disable-line no-unused-vars
import * as app from '.'; // eslint-disable-line @typescript-eslint/no-unused-vars
// These need to be var not let so they get hoisted
// and can be used by jest.mock (which is also hoisted)

13
tsconfig.json Normal file
View File

@@ -0,0 +1,13 @@
{
"extends": "@edx/typescript-config",
"compilerOptions": {
"baseUrl": "./src",
"paths": {
"*": ["*"]
},
"rootDir": ".",
"outDir": "dist"
},
"include": ["*.js", ".eslintrc.js", "src/**/*", "plugins/**/*", "jest.config.ts"],
"exclude": ["*.js", ".eslintrc.js", "dist", "node_modules"]
}