noSkippedTests
¥Summary
-
规则生效日期:
v1.6.0¥Rule available since:
v1.6.0 -
诊断类别:
lint/suspicious/noSkippedTests¥Diagnostic Category:
lint/suspicious/noSkippedTests -
此规则包含 unsafe 修复程序。
¥This rule has an unsafe fix.
-
此规则的默认严重级别为 warning。
¥The default severity of this rule is warning.
-
来源:
¥Sources:
-
¥Inspired from
jest/no-disabled-tests -
¥Inspired from
vitest/no-disabled-tests
-
¥How to configure
{ "linter": { "rules": { "suspicious": { "noSkippedTests": "error" } } }}¥Description
禁止禁用测试。
¥Disallow disabled tests.
禁用测试在开发和调试时很有用,尽管它们不应该在生产中提交。
¥Disabled test are useful when developing and debugging, although they should not be committed in production.
¥Examples
¥Invalid
describe.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
test.only("test", () => {});test("test", () => {});¥Related links
Biome v2.1 中文网 - 粤ICP备13048890号