Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Teardown browser in watch mode. #270

Merged
merged 1 commit into from
Jul 23, 2019

Conversation

adunkman
Copy link
Contributor

Summary

Fixes #269.

When jest is running with --watch, each test run creates a new browser — so we’ll want to teardown the browser to avoid memory leaks.

Test plan

I manually tested this — not sure how to write an automated test since it involves the setup and teardown process itself.

  • I started the dev server by running PORT=4444 node server, since the dev server is not started in --watch mode (see In watch mode server doesn't start #229).
  • In another terminal window, I ran yarn test --watch.
    • Observe that the browser is closed at the end of a test run.
    • I hit a to re-run all tests.
    • Observe a new browser is started, the tests are run, and it is closed.
    • Repeat forever!

When jest is running in Watch mode, each test run creates a new browser — so we’ll want to teardown the browser to avoid memory leaks.
@gregberge gregberge merged commit 04de87a into argos-ci:master Jul 23, 2019
@gregberge
Copy link
Member

Thanks!

@adunkman adunkman deleted the dispose-during-watch branch July 23, 2019 14:08
@Jiang-Xuan
Copy link

is ready to use?

@andreyctkn
Copy link

andreyctkn commented Nov 5, 2019

@vcfvct
Copy link

vcfvct commented Dec 2, 2019

Same here, Any timeline to publish this?
For now we have to modify the source code to get this behavior.

Thanks!

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

Successfully merging this pull request may close these issues.

Puppeteer browser is not disposed of during teardown when running jest with --watch.
5 participants