Skip to content

jest/prefer-strict-equal Style

🛠️ An auto-fix is available for this rule.

What it does

This rule triggers a warning if toEqual() is used to assert equality.

Example

javascript
// invalid
expect({ a: "a", b: undefined }).toEqual({ a: "a" });

// valid
expect({ a: "a", b: undefined }).toStrictEqual({ a: "a" });

References

Released under the MIT License.