Upgrading tests, replacing Enzyme with TestRenderer

This commit is contained in:
James Barnsley
2022-09-29 10:38:26 +13:00
parent 129ed32f88
commit 6d6a2b4f24
14 changed files with 7381 additions and 160 deletions

View File

@ -1,36 +1,43 @@
module.exports = {
verbose: true,
collectCoverage: true,
testEnvironment: 'jsdom',
testMatch: [
"<rootDir>/__tests__/**/*.test.js?(x)",
],
moduleDirectories: [
"node_modules",
"src",
],
moduleFileExtensions: [
"js",
"jsx",
"yaml",
],
// moduleDirectories: [
// "node_modules",
// "src",
// ],
// moduleFileExtensions: [
// "js",
// "jsx",
// "yaml",
// ],
moduleNameMapper: {
/*"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga|yml|yaml)$": "<rootDir>/__mocks__/fileMock.js",*/
"^.+\\.(css|scss|sass|less)$": "identity-obj-proxy",
},
transform: {
"\\.yaml$": "yaml-jest",
"^.+\\.jsx$": "babel-jest",
"^.+\\.js$": "babel-jest",
"^.+\\.ts$": "babel-jest",
"^.+\\.tsx$": "babel-jest",
"^.+\\.(j|t)sx?$": "babel-jest",
"^.+\\.ya?ml$": "<rootDir>/__tests__/jest-yaml-transformer.js",
},
transformIgnorePatterns: [
"node_modules/(?!react-dnd|core-dnd|@react-dnd|dnd-core|react-dnd-html5-backend|react-redux)"
],
coverageReporters: [
"lcov",
],
collectCoverageFrom: [
"src/**/*.{js,jsx,ts,tsx}",
],
setupFilesAfterEnv: [
"./__tests__/setup.js"
],
globals: {
window: {
location: {
hostname: 'localhost',
port: 6680,
protocol: 'http',
},
},
},
};