modernweb-dev / web

Guides, tools and libraries for modern web development.
https://modern-web.dev
MIT License
2.22k stars 288 forks source link

Unexpected behavior in window when using flat --watch #248

Open UpperCod opened 4 years ago

UpperCod commented 4 years ago

The error occurs when using the --watch flag:

No watch: All tests are successfully passed.

Chrome: |██████████████████████████████| 9/9 test files | 35 passed, 0 failed

Finished running tests in 1.5s, all tests passed! �

With Watch: A wait is generated for certain tests that exceed the response timeout.

src\tests\element.test.jsx:

 ❌ Browser did not start after 30000ms.

src\hooks\tests\create-hooks.test.js:

 ❌ Browser did not start after 30000ms.

Chrome: |██████████████████████████████| 9/9 test files | 21 passed, 0 failed

Finished running tests, watching for file changes...

Press F to focus on a test file.
Press D to debug in the browser.
Press Q to quit watch mode.
Press Enter to re-run all tests.

I share the links to the tests

  1. https://github.com/atomicojs/atomico/tree/one/src/tests
  2. https://github.com/atomicojs/atomico/tree/one/src/hooks/tests

Only in a test is the parameter done used . https://github.com/atomicojs/atomico/blob/one/src/tests/render.test.jsx#L116.

Files that exceed the Timeout do not have a pattern.

OS : Windows 10 Pro NODE : 14.5.0

I would like to document this error more, but a log about it is not generated by NPM or the CLI

LarsDenBakker commented 4 years ago

I finally got a windows environment working :) I'm getting this error as well in your repository.

This error is logged when the browser never pinged back, so it didn't even get to running your tests. I spent some time debugging, but I didn't find out what's causing it yet. Will look into it more.

LarsDenBakker commented 4 years ago

I think the issue is related to a mismatch between puppeteer and your installed version of Chrome. Can you try with --puppeteer? You will need to install @web/test-runner-puppeteer. This will download a Chromium version compatible with that version of puppeteer.

I'm curious if that resolves. It would be quite annoying, I know puppeteer is quite closely related to the version of Chrome/Chromium but I had hoped that it wouldn't be a problem for our usage.