简体   繁体   English

一旦从扩展侧边栏关闭“自动运行”,如何保持测试快捷方式/图标?

[英]How keep tests shortcuts/icons once `auto-run` is switched off from the extension sidebar?

Currently Jest in my VSCode uses the --watch parameter (I use the Orta.vscode-jest extension), which mean when I save a file, it will run all tests in uncommitted files.目前我的 VSCode 中的 Jest 使用--watch参数(我使用Orta.vscode-jest扩展名),这意味着当我保存文件时,它将在未提交的文件中运行所有测试。

It's a good default behavior but sometimes my upcoming commit may imply multiple files and I don't want to waste 75% of my time and resources on tests I don't to focus on.这是一个很好的默认行为,但有时我即将进行的提交可能意味着多个文件,我不想将 75% 的时间和资源浪费在我不关注的测试上。

After reading documentation, I found I can turn off the auto-run (see arrow below), so now when saving nothing happens, and I was expecting a way to trigger manually the test I want.阅读文档后,我发现我可以关闭auto-run (见下面的箭头),所以现在保存时没有任何反应,我期待一种手动触发我想要的测试的方法。

在此处输入图像描述

Unfortunately once done it's like if the extension was totally shut down.不幸的是,一旦完成,就像扩展完全关闭一样。 See below, I have no longer the ability to run tests through the extension.见下文,我不再能够通过扩展运行测试。

在此处输入图像描述

Do you know a way to solve this?你知道解决这个问题的方法吗? Keeping icon buttons to trigger manually specific tests?保留图标按钮以手动触发特定测试?

I saw some homemade solution https://stackoverflow.com/a/55279902/3608410 (see Running a selected Jest test in Visual Studio Code ) but I feel it's weird since we have a powerful extension already installed.我看到了一些自制的解决方案https://stackoverflow.com/a/55279902/3608410 (请参阅Running a selected Jest test in Visual Studio Code )但我觉得这很奇怪,因为我们已经安装了一个强大的扩展。

(maybe I missed something...) (也许我错过了什么......)

Thank you,谢谢你,

Didn't see that before but if doing a right click in the test file where needed, in the menu I'm able to run a specific test, handy!之前没有看到,但是如果在需要的地方右键单击测试文件,我可以在菜单中运行特定的测试,方便!

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2025 STACKOOM.COM