-
-
Save shinypb/014c80a45c3049e36b64 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
expect(x).toEqual(y); compares objects or primitives x and y and passes if they are equivalent | |
expect(x).toBe(y); compares objects or primitives x and y and passes if they are the same object | |
expect(x).toMatch(pattern); compares x to string or regular expression pattern and passes if they match | |
expect(x).toBeDefined(); passes if x is not undefined | |
expect(x).toBeUndefined(); passes if x is undefined | |
expect(x).toBeNull(); passes if x is null | |
expect(x).toBeTruthy(); passes if x evaluates to true | |
expect(x).toBeFalsy(); passes if x evaluates to false | |
expect(x).toContain(y); passes if array or string x contains y | |
expect(x).toBeLessThan(y); passes if x is less than y | |
expect(x).toBeGreaterThan(y); passes if x is greater than y | |
expect(function(){fn();}).toThrow(e); passes if function fn throws exception e when executed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment