-
Notifications
You must be signed in to change notification settings - Fork 6
/
jest.config.ts
27 lines (25 loc) · 941 Bytes
/
jest.config.ts
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
import type { Config } from '@jest/types';
const config: Config.InitialOptions = {
transform: {
// '.(ts|tsx)$': require.resolve('ts-jest/dist'),
'^.+\\.tsx?$': 'esbuild-jest',
'^.+\\.jsx?$': 'esbuild-jest',
'.(js|jsx)$': require.resolve('babel-jest'), // jest's default
},
transformIgnorePatterns: ['[/\\\\]node_modules[/\\\\].+\\.(js|jsx)$'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
collectCoverageFrom: ['src/**/*.{ts,tsx,js,jsx}'],
testMatch: ['<rootDir>/**/*.(spec|test).{ts,tsx,js,jsx}'],
rootDir: '.',
watchPlugins: [
require.resolve('jest-watch-typeahead/filename'),
require.resolve('jest-watch-typeahead/testname'),
],
moduleNameMapper: {
'\\.(css|less)$': '<rootDir>/tests/cssStub.js',
},
snapshotSerializers: ['@emotion/jest/serializer'],
setupFilesAfterEnv: ['<rootDir>/tests/jest.setup.ts'],
testEnvironment: 'jsdom',
};
export default config;