2020-07-24 16:44:56 +08:00
|
|
|
module.exports = {
|
|
|
|
globals: {
|
|
|
|
// work around: https://github.com/kulshekhar/ts-jest/issues/748#issuecomment-423528659
|
|
|
|
'ts-jest': {
|
|
|
|
diagnostics: {
|
|
|
|
ignoreCodes: [151001],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
testEnvironment: 'jsdom',
|
|
|
|
transform: {
|
2020-07-27 16:17:41 +08:00
|
|
|
'^.+\\.vue$': 'vue-jest',
|
2020-09-21 15:39:53 +08:00
|
|
|
'^.+\\.(t|j)sx?$': [
|
2021-09-04 19:29:28 +08:00
|
|
|
'babel-jest',
|
|
|
|
{
|
2020-09-21 15:39:53 +08:00
|
|
|
presets: [
|
|
|
|
[
|
|
|
|
'@babel/preset-env',
|
|
|
|
{
|
2021-09-05 19:57:35 +08:00
|
|
|
loose: true,
|
2020-09-21 15:39:53 +08:00
|
|
|
targets: {
|
|
|
|
node: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
'@babel/preset-typescript',
|
|
|
|
],
|
2020-10-19 13:50:22 +08:00
|
|
|
plugins: [
|
|
|
|
'@vue/babel-plugin-jsx',
|
2021-09-05 19:57:35 +08:00
|
|
|
['@babel/plugin-proposal-class-properties', { loose: true }],
|
2020-10-19 13:50:22 +08:00
|
|
|
],
|
2020-09-21 15:39:53 +08:00
|
|
|
},
|
|
|
|
],
|
2020-07-24 16:44:56 +08:00
|
|
|
},
|
2020-10-27 16:52:43 +08:00
|
|
|
moduleFileExtensions: ['ts', 'tsx', 'js', 'json'],
|
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
|
|
|
|
// for example, ['<rootDir>/packages/input']
|
|
|
|
roots: ['<rootDir>'],
|
2020-07-24 16:44:56 +08:00
|
|
|
}
|