This commit is contained in:
27
jest.config.ts
Normal file
27
jest.config.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
export default {
|
||||
preset: 'ts-jest/presets/default-esm',
|
||||
testEnvironment: 'jsdom',
|
||||
setupFilesAfterEnv: ['<rootDir>/src/setupTests.ts'],
|
||||
moduleNameMapper: {
|
||||
'\\.(css|less|scss|sass)$': 'identity-obj-proxy',
|
||||
'\\.(jpg|jpeg|png|gif|webp|svg)$': '<rootDir>/src/__mocks__/fileMock.js',
|
||||
},
|
||||
transform: {
|
||||
'^.+\\.tsx?$': ['ts-jest', {
|
||||
useESM: true,
|
||||
tsconfig: 'tsconfig.test.json',
|
||||
diagnostics: {
|
||||
ignoreCodes: [1343]
|
||||
},
|
||||
astTransformers: {
|
||||
before: [
|
||||
{
|
||||
path: 'ts-jest-mock-import-meta',
|
||||
options: { metaObjectReplacement: { env: { VITE_API_KEY: 'test-key' } } }
|
||||
}
|
||||
]
|
||||
}
|
||||
}],
|
||||
},
|
||||
extensionsToTreatAsEsm: ['.ts', '.tsx'],
|
||||
};
|
||||
Reference in New Issue
Block a user