noSkippedTests
此内容尚不支持你的语言。
Diagnostic Category: lint/suspicious/noSkippedTests
Since: v1.6.0
Sources:
- Inspired from:
jest/no-disabled-tests
Description
Section titled DescriptionDisallow disabled tests.
Disabled test are useful when developing and debugging, although they should not be committed in production.
Examples
Section titled ExamplesInvalid
Section titled Invaliddescribe.skip("test", () => {});
code-block.js:1:10 lint/suspicious/noSkippedTests FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠ Don’t disable tests.
> 1 │ describe.skip(“test”, () => {});
│ ^^^^
2 │
ℹ Disabling tests is useful when debugging or creating placeholder while working.
ℹ If this is intentional, and you want to commit a disabled test, add a suppression comment.
ℹ Unsafe fix: Enable the test.
1 │ describe.skip(“test”,·()·=>·{});
│ -----
test.skip("test", () => {});
code-block.js:1:6 lint/suspicious/noSkippedTests FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠ Don’t disable tests.
> 1 │ test.skip(“test”, () => {});
│ ^^^^
2 │
ℹ Disabling tests is useful when debugging or creating placeholder while working.
ℹ If this is intentional, and you want to commit a disabled test, add a suppression comment.
ℹ Unsafe fix: Enable the test.
1 │ test.skip(“test”,·()·=>·{});
│ -----
Valid
Section titled Validtest.only("test", () => {});test("test", () => {});
How to configure
Section titled How to configure{ "linter": { "rules": { "suspicious": { "noSkippedTests": "error" } } }}