emgoto / emgoto-comments

This hosts the comments for my blog, emgoto.com.
https://emgoto.com
0 stars 0 forks source link

jest-partial-match/ #1

Open utterances-bot opened 3 years ago

utterances-bot commented 3 years ago

Jest partial matching on objects, arrays and functions · Emma Goto

Sometimes with Jest, you only need to test part of an object exists, or test on a subset of an array. We can do this using Jest’s partial…

https://www.emgoto.com/jest-partial-match/?utterances=d6a1cdc398c6ec3a2799a962GDG39pMeTEz32jc1B6zzzc2k%2BxCv192DHfTGKQNwztQ6B6j8Fav3BhgbvjNZmEnTnJH%2FnnZJGAD4thXM4IHF5yIf4lt0JYBxp2DGDdIRK%2Flq0zGgSVQ10MMKhu4%3D

emgoto commented 3 years ago

Testing, testing! My first comment 🎉

jwigert commented 2 years ago

Thanks for the great summary! Your post just helped me fix a broken test.

hendriklammers commented 2 years ago

Concise and to the point, I found exactly what I was looking for. Thanks!

neromir commented 2 years ago

This was very useful and helped me get over some jest testing hurdles I was having to deal with. Thanks!

jshwi commented 2 years ago

Thank you! Did not know about expect.anything().

nuri-engin commented 2 years ago

That was a perfect ARTICLE! Explaining the possible usage/features of Jest in a very detailed and understandable way.

Helped me a lot to fix a tedious test case :)

jplyue commented 2 years ago

Thank you so much!

ApplefaceLisa commented 1 year ago

Thanks for sharing and this is very helpful. But I have a question for how to handle the following: mockFunction({ignore: 'ignore', 'ignore', 'important'});

expect(mockFunction).toHaveBeenCalledWith( ??? );