Pattern: Invalid expect usage
Issue: -
The expect()
function must be called with a single argument and followed by a matcher function. Missing arguments, missing matchers, or incorrect matcher usage will cause tests to fail unexpectedly.
Example of incorrect code:
expect();
expect("something");
expect(value).toBeDefined;
expect(true, false).toBe(true);
Example of correct code:
expect("something").toBe("something");
expect(value).toBeDefined();
expect(Promise.resolve(1)).resolves.toBe(1);