Skip to content

jest/prefer-todo Style

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

What it does

When test cases are empty then it is better to mark them as test.todo as it will be highlighted in the summary output.

Why is this bad?

This rule triggers a warning if empty test cases are used without 'test.todo'.

Example

javascript
test("i need to write this test"); // invalid
test("i need to write this test", () => {}); // invalid
test.skip("i need to write this test", () => {}); // invalid

test.todo("i need to write this test");

References

Released under the MIT License.