![]() ![]() ![]() I hope my blog has inspired you to learn how to write tests with Jest and maybe even read Inifinite Jest or at least read one paragraph of the Infinite Jest Wikipedia page like I did. To be, or not to be, that is the question - Also straight outta Hamlet's mouth ![]() The novel Infinite Jest by David Foster Wallace was named for a line from Shakespeare's Hamlet and that is a fact I definitely knew before today.Īlas, poor Yorick! I knew him, Horatio: a fellow of infinite jest, of most excellent fancy: he hath borne me on his back a thousand times and now, how abhorred in my imagination it is! - Straight outta Hamlet's mouth toBe checks for strict equality (works for primitive types like strings and numbers) whereas 'toEqual recursively checks every field of an object or array' (thanks Jest Docs!). toMatch - used to check for regex matches toContain - used to check if an array contains an item not - expect(pageCount()).not.toBe('1 page') toEqual - used for checking objects and arrays I've listed some of the most common matches below: Infinite Jest by David Foster Wallace 86,896 ratings, 4.26 average rating, 10,527 reviews Open Preview Infinite Jest Quotes Showing 1-30 of 905 Everybody is identical in their secret unspoken belief that way deep down they are different from everyone else. Matchers are used to check the values in your expect methods. Instead, you will use expect along with a "matcher" function to assert something about a value. The expect function is used every time you want to test a value. Enter fullscreen mode Exit fullscreen mode ![]()
0 Comments
Leave a Reply. |