docs: how to run tests in watch mode
See original GitHub issueHow to run tests in watch mode? I assume nodemon
or watch is the answer ? Would love to see it included in examples as well.
cheers!
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Jest CLI Options
Watch mode also enables to specify the name or path to a file to focus on a specific set of tests. Using with...
Read more >Running Tests | Create React App
You can also press a in the watch mode to force Jest to run all tests. Jest will always run all tests on...
Read more >Run Tests | Basic Guides | Guides | Docs - TestCafe
There are two ways to launch TestCafe tests. The simplest option is to use the testcafe shell command. Alternatively, you can launch tests...
Read more >Watching Files for Changes - Node Tap
When developing a projects, it's useful to run tap in watch mode. In this mode, tap will watch your project for changes to...
Read more >Test an Editor Add-on | Apps Script - Google Developers
Under Saved Tests, select the radio button next to the saved test deployment you want to run and click Execute. The test document...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok. I have created
watchlist
, which is my first pass at a CLI watcher. I will need some feedback in order to bring this to 1.0 – I know there are inconsistencies with Windows right now, but it’s late for me and I don’t currently have access to a Windows machine.The
watchlist
usage is exactly as described earlier:The
--
is important – it’s what separateswatchlist
from the command you want to run. It’s also what makes it possible to pass option flags to your command (uvu
in this case):I will add a
/docs
item tomorrow for this.Right now I’d use something like
watchexec
– which would look like this:This (recursively) watches all files within the
src
andtests
directories, rerunningnpm test
whenever there’s a change.Although I might make my own watch CLI, which would look something like:
It was suggested that
uvu --watch
exists, which I can’t say i’m 100% against, however, my hesitation with that (and it applies to my own watch CLI too) is that I still have to either (a) include all ofchokidar
; or (b) become familiar with the bugs/edge cases thatchokidar
solves & apply them to my own solution; © just rely on nativefs.FSWatcher
and hope for the best.The benefit of a separate watch CLI is that those solutions/problems are contained to that module. If
uvu --watch
exists and proves to be buggy, then everyone inherits that code and it becomes a problem or it becomes big & burly. And there will be users (myself included) that never reach for that feature and it’s just there taking up space.Sorry I’m ranting now – but to wrap up: I think all-in-one solutions can sometimes be nice, but especially in the JS community, I think we forget that CLIs are meant to be piped into and chained together. A CLI should do one thing well and be flexible enough to work with other CLIs – or at least self-contained so that it doesn’t matter how it gets invoked. Because of this, I’m definitely leaning towards a separate watch CLI, although I do understand the appeal of a
uvu
builtin.