Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 661 Bytes

expect-single-argument.md

File metadata and controls

31 lines (22 loc) · 661 Bytes

Enforce expect having a single argument (expect-single-argument).

Ensure expect is called with a single argument.

Rule details

This rule triggers a warning if expect is called with more than one argument or without arguments when not followed by a nothing().

expect();
expect("something", "more");

Default configuration

The following patterns are considered warnings:

expect();
expect().toEqual("something");
expect("something", "else");

The following patterns are not warnings:

expect("something").toEqual("something");
expect([1, 2, 3]).toEqual([1, 2, 3]);
expect(true).toBeDefined();
expect().nothing();