Add setup file and remove old testing mock that no longer exists from moduleNameMapper
This commit is contained in:
@@ -1,12 +1,11 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
preset: "ts-jest",
|
preset: "ts-jest",
|
||||||
testEnvironment: "jsdom",
|
testEnvironment: "jsdom",
|
||||||
|
setupFilesAfterEnv: [
|
||||||
|
'<rootDir>/src/setupTests.ts'
|
||||||
|
],
|
||||||
moduleNameMapper: {
|
moduleNameMapper: {
|
||||||
"^@/(.*)$": "<rootDir>/src/$1",
|
"^@/(.*)$": "<rootDir>/src/$1"
|
||||||
"^../components/DynamicJsonForm$":
|
|
||||||
"<rootDir>/src/utils/__mocks__/DynamicJsonForm.ts",
|
|
||||||
"^../../components/DynamicJsonForm$":
|
|
||||||
"<rootDir>/src/utils/__mocks__/DynamicJsonForm.ts",
|
|
||||||
},
|
},
|
||||||
transform: {
|
transform: {
|
||||||
"^.+\\.tsx?$": [
|
"^.+\\.tsx?$": [
|
||||||
@@ -14,9 +13,9 @@ module.exports = {
|
|||||||
{
|
{
|
||||||
useESM: true,
|
useESM: true,
|
||||||
jsx: "react-jsx",
|
jsx: "react-jsx",
|
||||||
tsconfig: "tsconfig.jest.json",
|
tsconfig: "tsconfig.jest.json"
|
||||||
},
|
}
|
||||||
],
|
]
|
||||||
},
|
},
|
||||||
extensionsToTreatAsEsm: [".ts", ".tsx"],
|
extensionsToTreatAsEsm: [".ts", ".tsx"],
|
||||||
testRegex: "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
|
testRegex: "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
|
||||||
@@ -25,13 +24,13 @@ module.exports = {
|
|||||||
"/node_modules/",
|
"/node_modules/",
|
||||||
"/dist/",
|
"/dist/",
|
||||||
"/bin/",
|
"/bin/",
|
||||||
"\\.config\\.(js|ts|cjs|mjs)$",
|
"\\.config\\.(js|ts|cjs|mjs)$"
|
||||||
],
|
],
|
||||||
// Exclude the same patterns from coverage reports
|
// Exclude the same patterns from coverage reports
|
||||||
coveragePathIgnorePatterns: [
|
coveragePathIgnorePatterns: [
|
||||||
"/node_modules/",
|
"/node_modules/",
|
||||||
"/dist/",
|
"/dist/",
|
||||||
"/bin/",
|
"/bin/",
|
||||||
"\\.config\\.(js|ts|cjs|mjs)$",
|
"\\.config\\.(js|ts|cjs|mjs)$"
|
||||||
],
|
]
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user