jest/no-disabled-tests Correctness
What it does
This rule raises a warning about disabled tests.
Why is this bad?
Jest has a feature that allows you to temporarily mark tests as disabled. This feature is often helpful while debugging or to create placeholders for future tests. Before committing changes we may want to check that all tests are running.
Example
js
describe.skip("foo", () => {});
it.skip("foo", () => {});
test.skip("foo", () => {});
describe["skip"]("bar", () => {});
it["skip"]("bar", () => {});
test["skip"]("bar", () => {});
xdescribe("foo", () => {});
xit("foo", () => {});
xtest("foo", () => {});
it("bar");
test("bar");
it("foo", () => {
pending();
});
This rule is compatible with eslint-plugin-vitest, to use it, add the following configuration to your .eslintrc.json
:
json
{
"rules": {
"vitest/no-disabled-tests": "error"
}
}