Skip to content
This repository has been archived by the owner on Jun 11, 2021. It is now read-only.

Watch mode #33

Closed
jperl opened this issue Apr 27, 2020 · 5 comments
Closed

Watch mode #33

jperl opened this issue Apr 27, 2020 · 5 comments

Comments

@jperl
Copy link

jperl commented Apr 27, 2020

It would be nice to have a watch mode that automatically re-runs tests when the file is saved similar to cypress. #6

@JoelEinbinder
Copy link
Contributor

This should mostly work out of the box today!

Keeping the browser open requires global cleanup for Jest runners. I filed it as jestjs/jest#9795 and they seem open to it.

@jperl
Copy link
Author

jperl commented Apr 28, 2020

It's a total hack but we implemented this behavior in qawolf by creating a Jest watch plugin. We use shouldRunTestSuite to send a command via a tcp server to the test to close the browser. I would love to get rid of this and swap it out for playwright-runner.

@laurentpayot
Copy link

I use the following npm scripts to implement this behaviour with chokidar-cli:

"test:e2e": "cd tests/e2e && folio --workers `grep -c ^processor /proc/cpuinfo` --param screenshotOnFailure",
"test:e2e:watch": "npm run test:e2e ; cd tests/e2e && chokidar './**/*.ts' -c 'echo \"\n{path} was modified\n\" && cd ../.. && npm run test:e2e -- --test-match \"{path}\"'",

but it is nothing compared to the watch options Jest spoils us with.

@mxschmitt don't you think this issue should be re-opened?

@mxschmitt
Copy link
Member

yeah lets open I guess.

@mxschmitt
Copy link
Member

Closing as duplicate of https://github.com/microsoft/folio/issues/150 we track it there.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants