vitest
vitest copied to clipboard
feat!: `spy.mockReset` changes
Description
[!WARNING] This is a breaking change.
See #6378, #6308
This PR changes the behaviour of mockReset to the proposed behaviour of mockRevert in #6378.
That is, spy.mockReset() will reset the inner implementation of spy to its original.
Previously, spy.mockReset would reset the inner implementation of spy to () => undefined.
PR Checklist
- [x] It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
- [x] Ideally, include a test that fails without this PR but passes with it.
- [x] Please, don't make changes to
pnpm-lock.yamlunless you introduce a new test example.
Tests
- [x] Run the tests with
pnpm test:ci.
Documentation
- [x] If you introduce new functionality, document it. You can run documentation with
pnpm run docscommand.
Changesets
- [x] Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with
feat:,fix:,perf:,docs:, orchore:.
Deploy Preview for vitest-dev ready!
| Name | Link |
|---|---|
| Latest commit | c85d5d851f70f157a6c9780e0dc62a7fa7b470d8 |
| Latest deploy log | https://app.netlify.com/sites/vitest-dev/deploys/6751aeea41032100081f457b |
| Deploy Preview | https://deploy-preview-6426--vitest-dev.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.