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(jasmine): add matcher transforms that have no direct equivalent in jest, but can be expressed in other ways #614

Merged
merged 1 commit into from
Sep 8, 2024

Conversation

jase88
Copy link
Contributor

@jase88 jase88 commented Sep 7, 2024

added support for toBePositiveInfinity, toBeNegativeInfinity, toHaveSize, toHaveBeenCalledOnceWith, toHaveBeenCalledBefore, toHaveSpyInteractions

credits to @puglyfe

…in jest, but can be expressed in other ways:

added support for toBePositiveInfinity, toBeNegativeInfinity, toHaveSize, toHaveBeenCalledOnceWith, toHaveBeenCalledBefore, toHaveSpyInteractions
@jase88 jase88 changed the title feat(jasmine): add matcher transforms that have no direct equivalent in jest, but can be expressed in other ways: feat(jasmine): add matcher transforms that have no direct equivalent in jest, but can be expressed in other ways Sep 7, 2024
Copy link

codecov bot commented Sep 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.77%. Comparing base (a94e2b5) to head (7a919cd).
Report is 71 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #614      +/-   ##
==========================================
+ Coverage   92.38%   92.77%   +0.39%     
==========================================
  Files          26       27       +1     
  Lines        1944     2091     +147     
  Branches      405      425      +20     
==========================================
+ Hits         1796     1940     +144     
- Misses        102      103       +1     
- Partials       46       48       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -169,6 +183,10 @@ test('maps expect matchers', () => {
expect(stuff).not.toHaveBeenCalled();
expect(stuff).not.toHaveBeenCalled();
expect(stuff).toHaveBeenCalledWith('foo', 'bar');

expect(mySpy.mock.calls).toEqual([['foo', 'bar']]);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth double checking this one. I believe it should be mySpy.mock.calls[0], but we miss checking that it is only called once with those arguments.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the nested array implicitly asserts that mySpy.mock.calls.length === 1

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't realize the array was nested. All good then. 👍🏼

@skovhus skovhus merged commit a757ed5 into skovhus:main Sep 8, 2024
3 checks passed
@jase88 jase88 deleted the jasmine-matchers-with-no-equivalent branch September 9, 2024 17:27
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.

3 participants