question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Watch non-spec files for changes and reload specs

See original GitHub issue

Many 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:open
  • Created 7 years ago
  • Reactions:25
  • Comments:19 (4 by maintainers)

github_iconTop GitHub Comments

8reactions
kucebcommented, Jan 20, 2021

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

7reactions
Svishcommented, Jan 31, 2020

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 type invalid, and if any arrive, it clicks the restart button after a short delay.

https://www.npmjs.com/package/cypress-hmr-restarter

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found