-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathjest.config.mjs
More file actions
39 lines (33 loc) · 1.07 KB
/
jest.config.mjs
File metadata and controls
39 lines (33 loc) · 1.07 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
// jest.config.mjs
export default {
testEnvironment: 'jsdom',
// Transform ES modules from these packages
transformIgnorePatterns: [
'node_modules/(?!(@reduxjs/toolkit|@nostr-dev-kit|nostr-tools|@noble|@fedimint|redux|immer|reselect|redux-thunk)/)',
],
moduleNameMapper: {
// Assets
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/__mocks__/fileMock.js',
'\\.(css|less|scss)$': 'identity-obj-proxy',
},
// Use Babel for all transformations
transform: {
'^.+\\.(ts|tsx|js|jsx|mjs)$': [
'babel-jest',
{
presets: [
['@babel/preset-env', { targets: { node: 'current' } }],
['@babel/preset-react', { runtime: 'automatic' }],
'@babel/preset-typescript',
],
},
],
},
testMatch: ['<rootDir>/src/tests/**/*.test.{ts,tsx}'],
moduleDirectories: ['node_modules', 'src'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'mjs', 'json', 'node'],
// Clear mocks between tests
clearMocks: true,
restoreMocks: true,
};