Skip to content
This repository has been archived by the owner on Mar 20, 2019. It is now read-only.

Latest commit

 

History

History
30 lines (21 loc) · 606 Bytes

expect-single-argument.md

File metadata and controls

30 lines (21 loc) · 606 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.

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();