直接在Intellij Idea/WebStorm中运行玩笑测试吗? [英] Running jest tests directly in Intellij Idea/WebStorm?

查看:81
本文介绍了直接在Intellij Idea/WebStorm中运行玩笑测试吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 jest 在我的ReactJS应用程序中编写测试. 到目前为止,要运行我的测试套件,我需要输入'npm test'.

I'm using jest to write tests in my ReactJS application. So far, to run my test suite, I need to type 'npm test'.

这是package.npm中的代码段:

Here's the snippet from package.npm:

 "scripts": {
    "test": "./node_modules/.bin/jest",
    (other stuff)
  },
  "jest": {
    "unmockedModulePathPatterns": ["<rootDir>/node_modules/react"],
    "scriptPreprocessor": "<rootDir>/node_modules/babel-jest",
    "testFileExtensions": [
      "es6",
      "js"
    ],
    "moduleFileExtensions": [
      "js",
      "json",
      "es6"
    ]
  },

是否可以在我的IDE(IDEA/WebStorm)中直接运行这些测试,并保留配置?我不是js专家,但是例如WebStrom与Karma完美兼容. jest-cli也不可能吗?

Is it possible to run those tests within my IDE (IDEA/WebStorm) directly, preserving the configuration? I'm not a js guy, but for example WebStrom works perfectly fine with Karma. Shouldn't this be possible with jest-cli either?

推荐答案

要使Jest测试结果显示在树状视图(如因果等)中,需要特殊的集成. WebStorm尚不支持Jest.请投票给 WEB-14979 ,以通知任何进展.

To make Jest test results shown in a tree view (like karma, etc.), a special integration is needed. WebStorm doesn't yet support Jest. Please vote for WEB-14979 to be notified on any progress.

截至2017年3月,WebStorm的Jest集成的第一个版本

as of March 2017 the first version of Jest integration at WebStorm has been released.

这篇关于直接在Intellij Idea/WebStorm中运行玩笑测试吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆