-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.cjs
More file actions
26 lines (26 loc) · 845 Bytes
/
jest.config.cjs
File metadata and controls
26 lines (26 loc) · 845 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
module.exports = {
testEnvironment: 'jsdom',
transform: {
'^.+\\.(ts|tsx|js|jsx)$': ['babel-jest', { presets: ['@babel/preset-env', '@babel/preset-react', '@babel/preset-typescript'] }],
},
moduleNameMapper: {
'\\.(css|less|scss|sass)$': 'identity-obj-proxy',
'\\.(gif|ttf|eot|svg|png)$': '<rootDir>/__mocks__/fileMock.cjs',
'^src/(.*)$': '<rootDir>/src/$1',
},
setupFilesAfterEnv: ['<rootDir>/jest.setup.cjs'],
testMatch: ['**/__tests__/**/*.test.(ts|tsx)'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
transformIgnorePatterns: [
'/node_modules/(?!(@testing-library/jest-dom)/)',
],
extensionsToTreatAsEsm: ['.ts', '.tsx'],
moduleDirectories: ['node_modules', 'src'],
globals: {
'import.meta': {
env: {
VITE_APP_TMDB_TOKEN: 'mock-token'
}
}
}
};