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]: expect.any(String) always fails #29816

Open
awinograd opened this issue Dec 4, 2024 · 0 comments
Open

[Bug]: expect.any(String) always fails #29816

awinograd opened this issue Dec 4, 2024 · 0 comments

Comments

@awinograd
Copy link

Describe the bug

expect.any is modified due to @storybook/instrumenter so it's asymmetric matching capabilities are broken.

import { expect} from '@storybook/test';
expect('hi').toEqual(expect.any(String)) // throws an error

running the above line using expect from vitest passes as expected.

Reproduction link

https://stackblitz.com/edit/github-uhys1k?file=src%2Fstories%2FButton.stories.ts

Reproduction steps

  1. Go to above link.
  2. Open Button -> Primary story
  3. View "Instrumentation" add-on
  4. See error

System

Storybook Environment Info:

  System:
    OS: macOS 14.6.1
    CPU: (12) arm64 Apple M2 Max
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.15.1 - ~/.nodenv/versions/20.15.1/bin/node
    Yarn: 3.2.4 - ~/.nodenv/versions/20.15.1/bin/yarn <----- active
    npm: 10.7.0 - ~/.nodenv/versions/20.15.1/bin/npm
  Browsers:
    Chrome: 131.0.6778.109
    Safari: 17.6
  npmPackages:
    chromatic: ^11.5.1 => 11.5.1

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Empathy Backlog
Development

No branches or pull requests

2 participants