【问题标题】:Module <rootDir>/node_modules/vue-jest in the transform option was not found未找到转换选项中的模块 <rootDir>/node_modules/vue-jest
【发布时间】:2019-05-24 01:05:57
【问题描述】:

我遇到了一个错误,我需要你的帮助。感谢观看这个问题。

我的情况:我正在为我的项目配置 Drone CI 工具,当我在drone.yml 上运行单元测试时得到了这个。

Validation Error:

  Module <rootDir>/node_modules/vue-jest in the transform option was not found.

  Configuration Documentation:
  https://jestjs.io/docs/configuration.html

这是我的jest.conf.js

transform: {
    "^.+\\.js$": "babel-jest",
    ".*\\.vue$": "<rootDir>/node_modules/vue-jest"
  },

我尝试过的:

  1. 删除&lt;rootDir&gt;/node_modules/。但我收到另一个错误Module vue-jest in the transform option was not found.。所以我认为这不是正确的解决方案

【问题讨论】:

  • 修复了吗?这是如何解决的?
  • @Jayan 是的。我找到了解决方案。但是,距离现在太久了,我搬到了新公司。所以我现在不记得了。对不起。

标签: unit-testing vue.js vuejs2 jestjs babel-jest


【解决方案1】:
npm install --save-dev vue-jest

然后重新运行您的测试

【讨论】:

  • 即使包在 node_modules 文件夹中,我仍然遇到同样的问题
猜你喜欢
  • 2019-10-16
  • 2018-11-08
  • 2020-03-23
  • 2019-04-27
  • 1970-01-01
  • 1970-01-01
  • 2020-04-02
  • 2021-03-15
  • 2021-09-04
相关资源
最近更新 更多