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]: Asymmetric matchers in error of observable are timing out instead of failing #15012

Open
kyle-mcknight opened this issue Apr 6, 2024 · 1 comment

Comments

@kyle-mcknight
Copy link

Version

29.7.0

Steps to reproduce

  1. use my stackblitz https://stackblitz.com/edit/vitejs-vite-3dywfk?file=src%2Ftest.ts
  2. use the terminal in stackblitz to run npm run test

Expected behavior

test fails with message that updated isn't a string

Actual behavior

test fails with a timeout

Additional context

I encountered first when trying to implement my own matcher that would match a string against the ISO 8601 date standard. I thought the issue was with it being custom. I then noticed it happened with built-in matchers as well. When the positive conditions are met the test passes correctly but, when the conditions are negative the test will fail with a timeout instead of the proper error (the built-in or the custom message I would return in my custom matcher).

The attached stackblitz uses the built-in expect.any(String).

I'm unsure if this is my code or jest that is the issue; it seems like I've done things like this in the past.

Environment

It happens on any system, but here

  System:
    OS: Linux 5.15 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish)
    CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12700K
  Binaries:
    Node: 18.16.0 - ~/.nvm/versions/node/v18.16.0/bin/node
    Yarn: 1.22.21 - /mnt/d/program files/nodejs/yarn
    npm: 9.5.1 - ~/.nvm/versions/node/v18.16.0/bin/npm
Copy link

github-actions bot commented May 6, 2024

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant