mirror of
https://github.com/dec0dOS/zero-ui.git
synced 2025-07-07 13:31:43 -07:00
test: setup automated tests with jest
This commit is contained in:
parent
8785b94392
commit
23be268630
4 changed files with 745 additions and 15 deletions
32
frontend/jest.config.js
Normal file
32
frontend/jest.config.js
Normal file
|
@ -0,0 +1,32 @@
|
|||
// Add any custom config to be passed to Jest
|
||||
const customJestConfig = {
|
||||
setupFilesAfterEnv: ["<rootDir>/jest.setup.js"],
|
||||
moduleDirectories: ["node_modules", "<rootDir>/"],
|
||||
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",
|
||||
"\\.(png)$": "identity-obj-proxy",
|
||||
},
|
||||
testPathIgnorePatterns: ["<rootDir>/cypress/"],
|
||||
};
|
||||
|
||||
module.exports = customJestConfig;
|
Loading…
Add table
Add a link
Reference in a new issue