jest/prefer-strict-equal Style
What it does
This rule triggers a warning if toEqual()
is used to assert equality.
Examples
Examples of incorrect code for this rule:
javascript
expect({ a: "a", b: undefined }).toEqual({ a: "a" });
Examples of correct code for this rule:
javascript
expect({ a: "a", b: undefined }).toStrictEqual({ a: "a" });
How to use
To enable this rule in the CLI or using the config file, you can use:
bash
oxlint --deny jest/prefer-strict-equal --jest-plugin
json
{
"plugins": ["jest"],
"rules": {
"jest/prefer-strict-equal": "error"
}
}