Skip to content

Files

Latest commit

 

History

History
13 lines (8 loc) · 430 Bytes

chai-prefer-contains-to-index-of.md

File metadata and controls

13 lines (8 loc) · 430 Bytes

Pattern: Missing use of Chai .contain()

Issue: -

Description

Avoid Chai assertions that invoke indexOf and compare for a -1 result. It is better to use the chai .contain() assertion API instead because the failure message will be clearer if the test fails.

Further Reading