Jest-puppeteer: In `watch` mode server doesn't start

Created on 17 Apr 2019  路  9Comments  路  Source: smooth-code/jest-puppeteer

馃悰 Bug Report

If I specify a server and start jest in the watch mode, the server seems to not start at all.

To Reproduce

It's reproducable in the create-react-app example. Clone the jest-puppeteer repo, move to examples/create-react-app, install modules and run npm run test:integrationWithWatch. It will fail, although npm run test:integration will work fine.

Expected behavior

npm run test:integrationWithWatch should pass

Link to repl or repo (highly encouraged)

https://github.com/smooth-code/jest-puppeteer/tree/cc9bbfa493349cc88273120996e713523cf86714/examples/create-react-app

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 Mojave 10.14
 - CPU: (4) x64 Intel(R) Core(TM) i5-6267U CPU @ 2.90GHz
 - Memory: 1.08 GB / 16.00 GB
 - Shell: 3.2.57 - /bin/bash
## Binaries:
 - Node: 8.12.0 - /usr/local/bin/node
 - Yarn: 1.13.0 - /usr/local/bin/yarn
 - npm: 6.4.1 - /usr/local/bin/npm
 - Watchman: 4.9.0 - /usr/local/bin/watchman
## npmPackages:
 - jest-puppeteer: ^3.7.0 => 3.9.1
bug 馃悰 help wanted 馃啒

Most helpful comment

Sorry to comment on a closed issue @xiaoyuhen @neoziro, but I am seeing this error as well with a similar setup to the demo repo, with the following envinfo:

## System:
 - OS: macOS 10.14.5
 - CPU: (4) x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
 - Memory: 76.57 MB / 8.00 GB
 - Shell: 5.7.1 - /usr/local/bin/zsh
## Binaries:
 - Node: 12.4.0 - /usr/local/bin/node
 - Yarn: 1.16.0 - /usr/local/bin/yarn
 - npm: 6.9.0 - /usr/local/bin/npm
 - Watchman: 4.9.0 - /usr/local/bin/watchman
## npmPackages:
 - jest-puppeteer: ^4.2.0 => 4.2.0 

I believe this issue needs to be reopened.

All 9 comments

Hello @edoroshenko, thanks for the report, right now I don't have time to investigate it. @xiaoyuhen maybe?

Ummm, 馃I thought i was fix that before.

Will check this issues again.

Possible solution: I had installed watchman via npm install -g watchman but apparently this installs some garbage old version.

npm r -g watchman
brew install watchman

fixed the problem

I'm also seeing this issue, but not with the create-react-app example. It looks like that's because the example references jest-puppeteer 3.7.0, which predates commit cc9bbfa493349cc88273120996e713523cf86714.

I uploaded a minimal testcase at https://github.com/tobyn/jest-no-start-server. yarn test works, but yarn test --watchAll never tries to start the server at all. It just bails out of jest-puppeteer-environment's setup function here https://github.com/smooth-code/jest-puppeteer/blob/cc9bbfa493349cc88273120996e713523cf86714/packages/jest-environment-puppeteer/src/global.js#L23

Everything seems to work if I revert cc9bbfa493349cc88273120996e713523cf86714

@xiaoyuhen maybe there is more, can you double check please?

Sorry to comment on a closed issue @xiaoyuhen @neoziro, but I am seeing this error as well with a similar setup to the demo repo, with the following envinfo:

## System:
 - OS: macOS 10.14.5
 - CPU: (4) x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
 - Memory: 76.57 MB / 8.00 GB
 - Shell: 5.7.1 - /usr/local/bin/zsh
## Binaries:
 - Node: 12.4.0 - /usr/local/bin/node
 - Yarn: 1.16.0 - /usr/local/bin/yarn
 - npm: 6.9.0 - /usr/local/bin/npm
 - Watchman: 4.9.0 - /usr/local/bin/watchman
## npmPackages:
 - jest-puppeteer: ^4.2.0 => 4.2.0 

I believe this issue needs to be reopened.

Seems like indeed the issue is caused by the commit linked by @tobyn Hopefully it can be fixed soon.

Feel free to submit a PR.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aheissenberger picture aheissenberger  路  5Comments

paperbackdragon picture paperbackdragon  路  4Comments

tkrotoff picture tkrotoff  路  4Comments

alexander-elgin picture alexander-elgin  路  4Comments

testerez picture testerez  路  6Comments