2022-02-11 11:39:49 +08:00
|
|
|
/**
|
|
|
|
* @type import('@jest/types').Config.InitialOptions
|
|
|
|
*/
|
2020-07-24 16:44:56 +08:00
|
|
|
module.exports = {
|
2021-10-06 06:39:01 +08:00
|
|
|
setupFiles: ['./jest.setup.js'],
|
2022-02-21 14:28:22 +08:00
|
|
|
testMatch: [
|
|
|
|
'**/__tests__/**/*.[jt]s?(x)',
|
|
|
|
'**/?(*.)+(spec|test).[jt]s?(x)',
|
|
|
|
'!**/**vitest**',
|
|
|
|
],
|
2021-09-23 08:12:37 +08:00
|
|
|
testPathIgnorePatterns: ['/node_modules/', 'dist'],
|
2022-01-10 19:25:48 +08:00
|
|
|
modulePathIgnorePatterns: ['/node_modules/', 'dist', 'cypress'],
|
2020-07-24 16:44:56 +08:00
|
|
|
testEnvironment: 'jsdom',
|
|
|
|
transform: {
|
2022-02-11 12:10:56 +08:00
|
|
|
'\\.[jt]sx?$': 'babel-jest',
|
2022-03-15 19:23:38 +08:00
|
|
|
'^.+\\.vue$': '<rootDir>/internal/build/vue-jest-transformer.js',
|
2020-07-24 16:44:56 +08:00
|
|
|
},
|
2022-02-11 11:39:49 +08:00
|
|
|
moduleFileExtensions: ['ts', 'tsx', 'js', 'json', 'vue'],
|
2020-10-27 16:52:16 +08:00
|
|
|
// u can change this option to a more specific folder for test single component or util when dev
|
2022-01-08 20:03:13 +08:00
|
|
|
// for example, ['<rootDir>/packages/components/input']
|
2020-10-27 16:52:16 +08:00
|
|
|
roots: ['<rootDir>'],
|
2020-07-24 16:44:56 +08:00
|
|
|
}
|