mirror of
https://github.com/dec0dOS/zero-ui.git
synced 2025-07-05 20:41:43 -07:00
33 lines
1,009 B
JavaScript
33 lines
1,009 B
JavaScript
// Add any custom config to be passed to Jest
|
|
const customJestConfig = {
|
|
setupFilesAfterEnv: ["<rootDir>/jest.setup.js"],
|
|
moduleDirectories: ["node_modules", "<rootDir>/", "src"],
|
|
transform: {
|
|
// Use babel-jest to transpile tests with the below presets
|
|
// https://jestjs.io/docs/configuration#transform-objectstring-pathtotransformer--pathtotransformer-object
|
|
"^.+\\.(js|jsx|ts|tsx)$": [
|
|
"babel-jest",
|
|
{
|
|
presets: [
|
|
"@babel/preset-env",
|
|
[
|
|
"@babel/preset-react",
|
|
{
|
|
runtime: "automatic",
|
|
},
|
|
],
|
|
],
|
|
},
|
|
],
|
|
},
|
|
testEnvironment: "jest-environment-jsdom",
|
|
moduleNameMapper: {
|
|
"^uuid$": require.resolve("uuid"),
|
|
"^@fontsource/roboto$": "identity-obj-proxy",
|
|
"\\.(css)$": "identity-obj-proxy",
|
|
"\\.(png|pdf|svg|jpg|jpeg)$": "<rootDir>/__tests__/__mocks__/fileMock.js",
|
|
},
|
|
testPathIgnorePatterns: ["<rootDir>/cypress/"],
|
|
};
|
|
|
|
module.exports = customJestConfig;
|