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

[Bug]: Error: Playwright Test did not expect test() to be called here. #31348

Closed
hamirmahal opened this issue Jun 17, 2024 · 5 comments
Closed

Comments

@hamirmahal
Copy link

Version

^1.44.1

Steps to reproduce

  1. Clone https://github.com/hamirmahal/max-matrix-path/.
  2. Checkout the test/freezing-on-large-input branch.
  3. Run npm test, which currently just does vitest.
  4. You should see this error come up.

Alternatively, you can view https://github.com/hamirmahal/max-matrix-path/actions/runs/9555892127/job/26340058583.

Expected behavior

Adding Playwright shouldn't cause existing tests run with vitest to fail.

Actual behavior

A test that passed originally now fails after adding Playwright.

Additional context

No response

Environment

System:
    OS: Linux 6.5 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
    CPU: (8) x64 Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
    Memory: 19.66 GB / 31.03 GB
    Container: Yes
  Binaries:
    Node: 20.9.0 - ~/.nvm/versions/node/v20.9.0/bin/node
    Yarn: 1.22.22 - ~/.nvm/versions/node/v20.9.0/bin/yarn
    npm: 10.1.0 - ~/.nvm/versions/node/v20.9.0/bin/npm
    pnpm: 9.3.0 - ~/.local/bin/pnpm
  Languages:
    Bash: 5.1.16 - /usr/bin/bash
  npmPackages:
    @playwright/test: ^1.44.1 => 1.44.1
@hamirmahal
Copy link
Author

This might duplicate #30783.

@hamirmahal
Copy link
Author

@dgozman
Copy link
Contributor

dgozman commented Jun 18, 2024

@hamirmahal Well, you are trying to run playwright test from test/responsiveness.spec.ts with vitest, and it rightfully complains. You have to configure vitest to ignore this test file. Let me know whether that helps.

@hamirmahal
Copy link
Author

@dgozman that helps. It would be nice if vitest automatically was smart enough to know which tests are for vitest, and which tests are Playwright tests that it should ignore.

@dgozman
Copy link
Contributor

dgozman commented Jun 19, 2024

It would be nice if vitest automatically was smart enough to know which tests are for vitest, and which tests are Playwright tests that it should ignore.

You can try your luck and file an issue in vitest repository 😄


I'll close this one, since there is no action item from Playwright side.

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

No branches or pull requests

2 participants