Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vue-test-utils + jest 单元测试-vs code jest 插件 #51

Open
huangshuwei opened this issue Dec 25, 2020 · 0 comments
Open

vue-test-utils + jest 单元测试-vs code jest 插件 #51

huangshuwei opened this issue Dec 25, 2020 · 0 comments

Comments

@huangshuwei
Copy link
Owner

前言

编写单元测试用例时,难免频繁的执行单元测试命令。正所谓“工欲善其事,必先利其器”,这里推荐一块 vs code jest 单元测试插件

安装

1、通过浏览器点击安装 安装地址
2、vs code 插件市场搜索。插件名称: “Jest Runner” ,插件id:"firsttris.vscode-jest-runner"

使用

使用非常简单,随便打开一个你在编写的用例文件。

方法1:
每个用例上面都会有 “Run | Debug”提示。“Run”代表只运行用例,但不测试;“Debug”代表运行并且测试用例。
效果如下:
image

方法2:
在用例代码区域右键菜单,能够看到 “Debug Jest”、“Run Jest”、“Run Jest File” 三个选项,按照你自己的需求选择即可测试。
效果如下:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant