[Vue warn]:使用 jest 测试时无法解析异步组件

Ic3*_*m4n 5 javascript vue.js jestjs babeljs

我想测试一个动态导入另一个组件的组件。
测试正在运行,但我收到警告:

警告

这是我的 .babelrc :

{
  "plugins": ["@babel/plugin-syntax-dynamic-import"],
  "presets": [
    ["@babel/env", {
      "modules": false
    }]
  ],
  "env": {
    "test": {
      "presets": [
        ["@babel/env", {
          "targets": {
            "node": "current"
          }
        }]
      ]
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

还有我的 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',
  ],
};
Run Code Online (Sandbox Code Playgroud)

我该如何解决这个警告/错误?