-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.ts
36 lines (34 loc) · 1008 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
28
29
30
31
32
33
34
35
36
import type { Config } from 'jest';
const config: Config = {
moduleFileExtensions: ['js', 'jsx', 'json', 'vue', 'ts', 'tsx'],
moduleNameMapper: { '^@/(.*)$': '<rootDir>/src/$1' },
snapshotSerializers: ['jest-serializer-vue'],
testEnvironment: 'jsdom',
testEnvironmentOptions: {
customExportConditions: ['node', 'node-addons'],
url: 'http://localhost/',
},
testMatch: [
'**/tests/unit/**/*.spec.[jt]s?(x)',
'**/__tests__/*.[jt]s?(x)',
'**/?(*.)+(spec|test).[jt]s?(x)',
],
transform: {
'^.+\\.vue$': '@vue/vue3-jest',
'.+\\.(css|styl|less|sass|scss|jpg|jpeg|png|svg|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga|avif)$':
'jest-transform-stub',
'^.+\\.jsx?$': 'babel-jest',
'^.+\\.tsx?$': [
'ts-jest',
{
babelConfig: true,
},
],
},
transformIgnorePatterns: ['/node_modules/'],
watchPlugins: [
'jest-watch-typeahead/filename',
'jest-watch-typeahead/testname',
],
};
export default config;