我想测试一个动态导入另一个组件的组件。
测试正在运行,但我收到警告:
这是我的.babelrc:
{
"plugins": ["@babel/plugin-syntax-dynamic-import"],
"presets": [
["@babel/env", {
"modules": false
}]
],
"env": {
"test": {
"presets": [
["@babel/env", {
"targets": {
"node": "current"
}
}]
]
}
}
}
还有我的jest.config.js
module.exports = {
moduleFileExtensions: [
'js',
'json',
// tell Jest to handle *.vue files
'vue',
],
transform: {
// process js with babel-jest
'^.+\\.js$': '<rootDir>/node_modules/babel-jest',
// process *.vue files with vue-jest
'.*\\.(vue)$': '<rootDir>/node_modules/vue-jest',
},
// support the same @ -> src alias mapping in source code
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/$1',
},
// serializer for snapshots
snapshotSerializers: [
'<rootDir>/node_modules/jest-serializer-vue',
],
};
如何解决此警告/错误?