-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Incorrect error message in non-awaited expect.element() calls #8953
Copy link
Copy link
Labels
Description
Describe the bug
When not awaiting an expect.element() call, there seem to be an issue with the error text. it shows the error for expect.poll:

(image taken from vitest-dev/eslint-plugin-vitest#683)
Reproduction
test("renders name", async () => {
const element = page.getByText("Hello Vitest!");
expect.element(element).toBeInTheDocument();
});System Info
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.21.1 - /Users/**/.local/state/fnm_multishells/15956_1762412239648/bin/node
Yarn: 1.22.22 - /Users/**/.local/state/fnm_multishells/15956_1762412239648/bin/yarn
npm: 10.9.4 - /Users/**/.local/state/fnm_multishells/15956_1762412239648/bin/npm
pnpm: 10.20.0 - /Users/**/.local/state/fnm_multishells/15956_1762412239648/bin/pnpm
Browsers:
Chrome: 142.0.7444.60
Firefox Developer Edition: 144.0
Safari: 18.5
npmPackages:
@vitest/browser-playwright: ^4.0.7 => 4.0.7
vitest: ^4.0.7 => 4.0.7Used Package Manager
npm
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Reactions are currently unavailable