feat: setup tests env (#85)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
module.exports = {
|
||||
preset: 'ts-jest',
|
||||
transform: {
|
||||
'^.+\\.tsx?$': 'babel-jest',
|
||||
},
|
||||
@@ -8,7 +9,8 @@ module.exports = {
|
||||
collectCoverage: true,
|
||||
clearMocks: true,
|
||||
moduleNameMapper: {
|
||||
'\\.(svg|webp)$': '<rootDir>/__mocks__/file',
|
||||
'\\.(svg|webp)$': '<rootDir>/__mocks__/file-mock',
|
||||
'\\.(css|scss)$': '<rootDir>/__mocks__/style-mock',
|
||||
'react-i18next': '<rootDir>/__mocks__/react-i18next',
|
||||
},
|
||||
testEnvironmentOptions: {
|
||||
@@ -16,4 +18,5 @@ module.exports = {
|
||||
},
|
||||
testEnvironment: 'jest-fixed-jsdom',
|
||||
testPathIgnorePatterns: ['/node_modules/', '<rootDir>/e2e'],
|
||||
setupFilesAfterEnv: ['<rootDir>/jest-preset-it/jest.setup.js', '<rootDir>/__mocks__/brojs-cli-mock.ts', '<rootDir>/__mocks__/lottiefiles-mock.tsx'],
|
||||
};
|
||||
|
||||
5
jest-preset-it/jest.setup.js
Normal file
5
jest-preset-it/jest.setup.js
Normal file
@@ -0,0 +1,5 @@
|
||||
// eslint-disable-next-line @typescript-eslint/no-require-imports, no-undef
|
||||
require('@testing-library/jest-dom');
|
||||
|
||||
// eslint-disable-next-line no-undef
|
||||
global.__webpack_public_path__ = '';
|
||||
Reference in New Issue
Block a user