Appearance
此规则会对被注释掉的测试发出警告。它类似于 no-disabled-tests 规则。
no-disabled-tests
你可能会忘记取消注释某些测试。此规则会对被注释掉的测试发出警告。
如果测试不稳定,通常最好跳过它;如果不再需要,则将其移除。
以下是此规则的错误代码示例:
// describe('foo', () => {}); // it('foo', () => {}); // test('foo', () => {}); // describe.skip('foo', () => {}); // it.skip('foo', () => {}); // test.skip('foo', () => {});
To enable this rule using the config file or in the CLI, you can use:
{ "plugins": ["jest"], "rules": { "jest/no-commented-out-tests": "error" } }
import { defineConfig } from "oxlint"; export default defineConfig({ plugins: ["jest"], rules: { "jest/no-commented-out-tests": "error", }, });
oxlint --deny jest/no-commented-out-tests --jest-plugin
此规则在 v0.0.8 中添加。
jest/no-commented-out-tests Suspicious
作用
此规则会对被注释掉的测试发出警告。它类似于
no-disabled-tests规则。为什么这不好?
你可能会忘记取消注释某些测试。此规则会对被注释掉的测试发出警告。
如果测试不稳定,通常最好跳过它;如果不再需要,则将其移除。
示例
以下是此规则的错误代码示例:
如何使用
To enable this rule using the config file or in the CLI, you can use:
版本
此规则在 v0.0.8 中添加。
参考资料