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

feat: support Vitest mocking #686

Merged
merged 1 commit into from
Dec 17, 2024
Merged

feat: support Vitest mocking #686

merged 1 commit into from
Dec 17, 2024

Conversation

Tommy228
Copy link
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[X] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

Mocking features cannot be used with Vitest. Attempting to do so would fail as Spectator mocks with Jasmine by default

ReferenceError: jasmine is not defined
❯ ../../../node_modules/projects/spectator/src/lib/mock.ts:76:58

Issue Number: #679

What is the new behavior?

A new secondary entrypoint @ngneat/spectator/vitest has been added, which exports Vitest-compatible mocking methods.

Does this PR introduce a breaking change?

[ ] Yes
[X] No

Other information

I have tried to add Vitest support the same way Jest support was initially introduced.

I still have to test this on fresh Jasmine, Jest and Vitest setups but so far it looks to be working fine.

This PR does not update the existing schematics.

Copy link

stackblitz bot commented Dec 15, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@NetanelBasal
Copy link
Member

LGTM

I still have to test this on fresh Jasmine, Jest and Vitest setups but so far it looks to be working fine.

I will wait for this to see that it still works fine. I recommend release it locally using Verdaccio and install the package on fresh projects

@Tommy228
Copy link
Contributor Author

Thanks for the recommendation. It looks good after testing it with the 3 frameworks.

@Tommy228 Tommy228 marked this pull request as ready for review December 16, 2024 20:04
@NetanelBasal NetanelBasal merged commit 691c476 into ngneat:master Dec 17, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants