Skip to content

Commit

Permalink
chore: add jest.setup.ts to tsconfig, move jest config to separate file
Browse files Browse the repository at this point in the history
  • Loading branch information
hbuchel committed Dec 5, 2023
1 parent 3fbca04 commit a265b2f
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 29 deletions.
22 changes: 22 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module.exports = {
preset: './preset.js',
rootDir: './',
roots: ['<rootDir>/src'],
transform: {
'^.+\\.(ts|tsx|js|mjs)$': [
'babel-jest',
{
presets: ['next/babel']
}
]
},
testPathIgnorePatterns: ['capi', '.next', 'client'],
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
moduleNameMapper: {
'\\.(css|less|scss)$': '<rootDir>/src/__mocks__/styleMock.js',
'@/components/(.*)': '<rootDir>/src/components/$1',
'@/constants/(.*)': '<rootDir>/src/constants/$1',
'@/utils/(.*)': '<rootDir>/src/utils/$1'
},
transformIgnorePatterns: []
};
File renamed without changes.
28 changes: 0 additions & 28 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,34 +92,6 @@
"prismjs": "^1.27.0",
"@adobe/css-tools": "4.3.2"
},
"jest": {
"preset": "./preset.js",
"roots": [
"<rootDir>/src"
],
"transform": {
"^.+\\.(ts|tsx|js|mjs)$": [
"babel-jest",
{
"presets": [
"next/babel"
]
}
]
},
"testPathIgnorePatterns": [
"capi",
".next",
"client"
],
"setupFilesAfterEnv": [
"<rootDir>/jest.setup.js"
],
"moduleNameMapper": {
"\\.(css|less|scss)$": "<rootDir>/src/__mocks__/styleMock.js"
},
"transformIgnorePatterns": []
},
"scripts": {
"clean": "rm -rf node_modules yarn.lock",
"refresh": "yarn clean && yarn",
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"src/**/*.ts",
"src/**/*.tsx",
"tasks",
"adobe.d.ts"
"adobe.d.ts",
"jest.setup.ts"
]
}

0 comments on commit a265b2f

Please sign in to comment.