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

jest-puppeteer does not work properly with Node 18 #503

Closed
afternun opened this issue Nov 16, 2022 · 4 comments
Closed

jest-puppeteer does not work properly with Node 18 #503

afternun opened this issue Nov 16, 2022 · 4 comments
Labels

Comments

@afternun
Copy link

afternun commented Nov 16, 2022

🐛 Bug Report

A clear and concise description of what the bug is.

We have a setup of E2E tests of React app with puppeteer. After upgrading project from Node 16 to Node 18, jest-puppeteer fails to determine that server is up and running (it reaches launchTimeout). After some digging I found out that library uses wait-on library which seems to have an issue with IPv6 addresses (which are favoured by Node since 17) jeffbski/wait-on#127.

I tried starting only hot server yarn start and using wait-on to see if issue also occurs and it does. Increasing launchTimeout doesn't help, tool simply cannot determine if anything listens on that port.

To Reproduce

Steps to reproduce the behavior:

  1. Checkout repository or setup it on your own (create-react-app + puppeteer):
  2. nvm use 18
  3. yarn
  4. yarn test:e2e

image

Expected behavior

jest-puppeteer recognises that server is running and proceeds with running tests.

Link to repl or repo (highly encouraged)

https://gitlab.com/glayfieldWH/react-tests/-/tree/main/react-test

Run npx envinfo --system --binaries --npmPackages expect-puppeteer,jest-dev-server,jest-environment-puppeteer,jest-puppeteer,spawnd --markdown --clipboard

Paste the results here:

## System:
 - OS: macOS 12.3.1
 - CPU: (10) arm64 Apple M1 Pro
 - Memory: 339.67 MB / 16.00 GB
 - Shell: 5.8 - /bin/zsh
## Binaries:
 - Node: 18.12.1 - ~/.nvm/versions/node/v18.12.1/bin/node
 - Yarn: 1.22.19 - ~/.nvm/versions/node/v18.12.1/bin/yarn
 - npm: 8.19.2 - ~/.nvm/versions/node/v18.12.1/bin/npm
## npmPackages:
 - jest-puppeteer: ^6.1.1 => 6.1.1 
@afternun
Copy link
Author

afternun commented Nov 18, 2022

I tested using wait-port instead of wait-on. This changes waitOnScheme but works for HTTP servers. Haven't tested sockets yet. It would be probably easier and more reliable to fix wait-on...

@UziTech
Copy link
Contributor

UziTech commented Nov 20, 2022

I'm ok with breaking changes if we need to switch dependencies. We are going to need breaking changes for this package to work with the latest version of puppeteer and jest.

@Niek
Copy link

Niek commented Nov 23, 2022

+1

@gregberge
Copy link
Member

Upgraded and tested, should work now.

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

No branches or pull requests

4 participants