-
Notifications
You must be signed in to change notification settings - Fork 40
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
3.1.0 / 4.0.0 breaks existing test-suite/build with Invalid Chai property: toHaveReceivedCommandWith on vitest #216
Comments
Hi, the importing it from the transitive dependency breaks functionality with vitest.
|
I'm sorry for the problem and unexpected breaking change. However, the You are right that the breaking change is #198, which adds an explicit dependency on the That being said, I would love to support Vitest properly, including unit tests not to break anything in the future. I found a similar case in testing-library/jest-dom#511. Their solution provides three different imports for Jest and Vitest: import '@testing-library/jest-dom'; // default for Jest
import '@testing-library/jest-dom/jest-globals'; // for Jest using @jest/globals
import '@testing-library/jest-dom/vitest'; // for Vitest and I think something similar could be done here. We have the current import for Jest: import 'aws-sdk-client-mock-jest'; and a separate one could be created for Vitest:
If someone is willing to give it a try and make a PR - I would be glad to review it. Otherwise, I can't commit to any specific timeline from myself. |
While migrating from jest to vitest also stumbled upon this issue. I was able to resolve this by replacing aws-sdk-client-mock-jest with aws-sdk-client-mock-vitest |
The latest v4.1.0-beta.0 adds proper support for vitest thanks to @YiCChi You can test it, I'll release it as a regular version if no one reports any problems. See https://github.com/m-radzikowski/aws-sdk-client-mock?tab=readme-ov-file#vitest for instructions. |
Checklist
Bug description
When we upgrade from version 3.0.1 to 3.1.0 our build/tests break.
Maybe related to #198
Reproduction
npm install
npm run build
ornpm run test
failsCommit is broken (updates the dependency to 3.1.0), where as the initial commit works
Environment
The text was updated successfully, but these errors were encountered: