Watch non-spec files for changes and reload specs
See original GitHub issueMany of our users express the need to want to watch files on their system other than the *spec
files that we normally watch.
Although we currently watch the spec
file you’re currently working in (and all of the subdependencies) many of our users express the need to watch other files (like their src files) for e2e/integration tests.
We should do one or both options:
a) give you the ability to specific additional glob paths via cypress.json
b) give you the ability to watch things yourself and signal to cypress when to reload
With our upcoming CLI refactor we could offer something like this…
const chokidar = require('chokidar')
const cypress = require('cypress')
chokidar.watch(FILES)
.on('update', () => {
cypress.reload()
})
cypress.open()
Issue Analytics
- State:
- Created 7 years ago
- Reactions:25
- Comments:19 (4 by maintainers)
Top Results From Across the Web
How to watch public directory in Vite project for hot-reload?
json files, Vite doesn't watch it, and I have to refresh the page to see the changes. Is there a way to tell...
Read more >CVS--Concurrent Versions System
Instead, you use CVS commands to get your own copy of the files into a working directory, and then work on that copy....
Read more >Cisco Catalyst 8300 and Catalyst 8200 Series Edge Platforms ...
The Cisco Catalyst 8300 and 8200 Series Edge Platforms are best-of-breed, 5G-ready, cloud edge platforms designed for accelerated services, ...
Read more >G1000 SYSTEM MAINTENANCE MANUAL - Garmin
The content in this manual is nonspecific and is not associated to ... be accomplished by reloading the configuration files for the LRU,...
Read more >Nonspecific ST-T changes associated with unsatisfactory bloo...
The subjects were examined with electrocardiogram test at the initial visit in order to monitor baseline heart activity. According to the results of...
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
Reloading alongside webpack-dev-server
@jsphstls This is what I use: I listen for webpack-dev-server HMR logs in the console, and trigger a re-run, as described here https://stackoverflow.com/questions/52231111/re-run-cypress-tests-in-gui-when-webpack-dev-server-causes-page-reload/57980326#57980326
Edit: But you should use Svish’s package below
The method shared by @Bkucera doesn’t work for me, as there’s no such message being printed in the console. Agreeing with @jsphstls, that HMR already keeps track of changes, I decided to try hook into that. Ended up putting the result of the experiment in a simple package, and it seems to work pretty well on my machine with
create-react-app
at least 🙂👍It connects to the
webpack-dev-server
socket and listens for HMR messages of typeinvalid
, and if any arrive, it clicks the restart button after a short delay.➡ https://www.npmjs.com/package/cypress-hmr-restarter