August 2017
Beginner
374 pages
10h 41m
English
In JavaScript there are various kinds of truthy/falsy values. For example, an empty value could be represented as undefined, null, or false. Jest offers various matchers for these cases:
For example, null will pass the check for the following matchers:
test('null', () => { const n = null expect(n).toBeNull() expect(n).toBeDefined() expect(n).not.toBeUndefined() expect(n).not.toBeTruthy() expect(n).toBeFalsy()}
On the ...
Read now
Unlock full access