Fix tests

This commit is contained in:
Robin Townsend 2023-06-30 18:45:32 -04:00
parent 17450b4531
commit 9704033dc8
3 changed files with 11 additions and 2 deletions

View File

@ -8,7 +8,12 @@ module.exports = {
}, },
}, },
], ],
[
"@babel/preset-react", "@babel/preset-react",
{
runtime: "automatic",
},
],
"@babel/preset-typescript", "@babel/preset-typescript",
], ],
plugins: ["babel-plugin-transform-vite-meta-env"], plugins: ["babel-plugin-transform-vite-meta-env"],

View File

@ -120,7 +120,8 @@
"/node_modules/(?!internmap)+$" "/node_modules/(?!internmap)+$"
], ],
"moduleNameMapper": { "moduleNameMapper": {
"\\.(css|less|svg)+$": "identity-obj-proxy", "\\.css$": "identity-obj-proxy",
"\\.svg$": "<rootDir>/test/mocks/svgr.ts",
"^\\./IndexedDBWorker\\?worker$": "<rootDir>/test/mocks/workerMock.ts", "^\\./IndexedDBWorker\\?worker$": "<rootDir>/test/mocks/workerMock.ts",
"^\\./olm$": "<rootDir>/test/mocks/olmMock.ts" "^\\./olm$": "<rootDir>/test/mocks/olmMock.ts"
}, },

3
test/mocks/svgr.ts Normal file
View File

@ -0,0 +1,3 @@
// Mock file for SVG imports
export default "SvgrURL";
export const ReactComponent = "div";