We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This works with Jest:
expect({ str: 'abcd'}).toHaveProperty('str', expect.any(String));
Doesn't with Vitest:
❯ test/basic.test.ts:6:26 4| 5| test('expect.any', () => { 6| expect({ str: 'abcd' }).toHaveProperty('str', expect… | ^ 7| }); 8| - Expected "Any<String>" + Received "abcd"
https://stackblitz.com/edit/node-fhkkmq?file=test/basic.test.ts
System: OS: macOS 12.4 CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz Memory: 893.54 MB / 16.00 GB Shell: 3.4.1 - /usr/local/bin/fish Binaries: Node: 16.14.2 - ~/.asdf/installs/nodejs/16.14.2/bin/node Yarn: 1.22.18 - /usr/local/bin/yarn npm: 8.5.0 - ~/.asdf/plugins/nodejs/shims/npm Watchman: 2022.05.30.00 - /usr/local/bin/watchman Browsers: Brave Browser: 101.1.38.119 Chrome: 103.0.5060.114 Firefox: 102.0 Safari: 15.5 npmPackages: vite: ^3.0.2 => 3.0.2 vitest: ^0.18.1 => 0.18.1
npm
The text was updated successfully, but these errors were encountered:
fix: toHaveProperty with expect.any (fix: vitest-dev#1675)
ed9a633
35112e3
No branches or pull requests
Describe the bug
This works with Jest:
Doesn't with Vitest:
Reproduction
https://stackblitz.com/edit/node-fhkkmq?file=test/basic.test.ts
System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: