ESLint plugin
This project is maintained by iliubinskii
ESLint plugin / jest/no-toThrow-literal
Disallows string argument in “toThrow” matcher.
module.exports = {
plugins: ["misc"],
rules: {
"misc/jest/no-toThrow-literal": "error"
}
};
expect(f).toThrow("Error message");
expect(f).toThrow(new Error("Error message"));