-
Notifications
You must be signed in to change notification settings - Fork 636
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(expect): add asymmetric matchers (#3964) #4366
Conversation
javihernant
commented
Feb 21, 2024
•
edited
Loading
edited
- expect.anything
- expect.any
- expect.arrayContaining
- expect.not.arrayContaining
776dc69
to
ea17f72
Compare
@iuioiua is this going the right direction? Are you missing something? |
I'll leave this one to @kt3k, who's lead |
expect/_anything_test.ts
Outdated
import { expect } from "./expect.ts"; | ||
import { AssertionError, assertThrows } from "../assert/mod.ts"; | ||
|
||
Deno.test("expect().anything()", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
Deno.test("expect().anything()", () => { | |
Deno.test("expect.anything()", () => { |
@javihernant This looks heading in the right direction to me! |
f735a8f
to
83b554e
Compare
83b554e
to
112f793
Compare
e2851f0
to
893ac97
Compare
893ac97
to
7d9e8cc
Compare
Deno.test("expect.anything() as a parameter of toHaveBeenCalled()", () => { | ||
const mockFn = fn(); | ||
mockFn(3); | ||
expect(mockFn).toHaveBeenCalledWith(expect.anything()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks nicely implemented and tested! Thanks for your contribution!