跳至內容

jest/no-commented-out-tests 可疑

此規則的作用

此規則會對被註解掉的測試發出警告。它類似於 no-disabled-tests 規則。

為何這是不好的?

你可能會忘記取消註解某些測試。此規則會對被註解掉的測試發出警告。它類似於 no-disabled-tests 規則。

範例

javascript
// describe('foo', () => {});
// it('foo', () => {});
// test('foo', () => {});

// describe.skip('foo', () => {});
// it.skip('foo', () => {});
// test.skip('foo', () => {});

此規則與 eslint-plugin-vitest 相容,要使用它,請將以下設定添加到你的 .eslintrc.json

json
{
  "rules": {
    "vitest/no-commented-out-tests": "error"
  }
}

參考資料

以 MIT 授權發布。