---
url: /docs/guide/usage/linter/rules/vitest/prefer-todo.md
---

### 它的作用

当测试用例为空时，最好将它们标记为 `test.todo`，这样它们会在摘要输出中被高亮显示。

### 为什么这不好？

如果在不使用 `test.todo` 的情况下使用空测试用例，此规则会触发警告。

### 示例

此规则的**错误**代码示例：

```javascript
test("i need to write this test"); // 无效
test("i need to write this test", () => {}); // 无效
test.skip("i need to write this test", () => {}); // 无效
```

此规则的**正确**代码示例：

```javascript
test.todo("i need to write this test");
```

## 如何使用

## 版本

此规则是在 v0.0.16 中添加的。

## 参考资料
