Skip to content

Commit

Permalink
test: migrate from Vitest to Jest (#459)
Browse files Browse the repository at this point in the history
Co-authored-by: Noam Gaash <noam.gaash@gmail.com>
  • Loading branch information
R894 and NoamGaash authored Feb 13, 2024
1 parent d4a4a7f commit b802c99
Show file tree
Hide file tree
Showing 13 changed files with 2,320 additions and 313 deletions.
7 changes: 7 additions & 0 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"presets": [
"@babel/preset-env",
["@babel/preset-react", { "runtime": "automatic" }]
],
"plugins": ["babel-plugin-transform-import-meta"]
}
1 change: 1 addition & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ module.exports = [
'storybook-static',
'eslint.config.js',
'.nx',
'jest.config.ts'
],
},
]
27 changes: 27 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
export default {
preset: 'ts-jest',
testEnvironment: 'jest-environment-jsdom',
transform: {
'^.+\\.tsx?$': 'ts-jest',
// process `*.tsx` files with `ts-jest`
},
moduleNameMapper: {
'\\.(gif|ttf|eot|svg|png)$': '<rootDir>/tests/mocks/fileMock.js',
'^.+\\.(css|less|scss)$': 'identity-obj-proxy',
},
testPathIgnorePatterns: [
'/node_modules/',
'/tests/', // Ignoring this folder since playwright tests are here
],
collectCoverageFrom: [
'**/src/**/*.{js,jsx,ts,tsx}',
'!**/src/svgLoader.d.ts',
'!**/src/{test_pages,complaint}/**',
'!**/src/pages/DataResearch/**',
'!**/src/pages/homepage/**',
'!**/src/**/{setupProxy,log}.{ts,tsx}',
'!**/*.{test,spec,config,stories}.*'
],
modulePaths: ['<rootDir>'],
setupFilesAfterEnv: ['<rootDir>/setupTests.ts'],
}
Loading

0 comments on commit b802c99

Please sign in to comment.