Raathigesh / majestic

⚡ Zero config GUI for Jest
MIT License
7.49k stars 173 forks source link

FR: single file watch mode #192

Closed gregveres closed 4 years ago

gregveres commented 4 years ago

Is this a bug report or a feature request?

feature request

Version Info

Reproduction Repo

There is a watch mode in Majestic already. It would be nice if there was a way to execute a watch mode on a single file. Jest supports this. I would recommend that a new button with the eye icon be added beside the run icon. In order to save space, the word run could be dropped from that button.

The benefit of this would be automatic running of tests from a single file. I find myself (and I assume others) end up working in a single test file for a while, writing and fixing a number of tests related to that file. Yes there is the overall watch mode that can be used, but I have found that it runs too many tests and takes longer than it needs to.

gregveres commented 4 years ago

It turns out that this is already implemented. When I went looking in the code for how to implement this, I found that it is already implemented. Here is how you enable it:

click on the "start watching" button on the left side panel. Then find the test file you want to run in watch mode. click on that file to make it visible in the right panel click on the run button in the upper right window of the single test panel.

This then runs jest in watch mode (because watch mode was toggled on) but for a the single file. It is now much faster running tests for this file over and over again as you work on the file.