# bun:test/no-commented-out-tests

> Disallow tests that are inside a comment

A test inside a comment never runs, and the test output doesn't say so. It's easy to comment one out while debugging and forget about it.

To turn a test off for now, use `test.skip` or `test.todo`, which show up in the summary. If nobody needs the test, delete it.

A comment is reported if one of its lines starts with a call to `test`, `it` or `describe`. That includes `xtest`, `fit`, `test.only` and the like.

{/* Generated by src/codegen/lint-rule-docs.ts. Do not edit this section. */}

## Configure

Off by default. To turn it on:

```toml bunfig.toml
[lint.rules]
"bun:test/no-commented-out-tests" = "error" # or "warn"
```

{/* End of the generated section. */}

## Examples

Reported:

{/* bad */}
```ts
import { expect, test } from "bun:test";

// test("rounds down", () => {
//   expect(Math.floor(1.9)).toBe(1);
// });
```

{/* bad */}
```ts
import { describe, expect, it } from "bun:test";

describe("Math.floor", () => {
  /*
  it.only("rounds down", () => {
    expect(Math.floor(1.9)).toBe(1);
  });
  */
});
```

Not reported:

{/* good */}
```ts
import { expect, test } from "bun:test";

test.skip("rounds down", () => {
  expect(Math.floor(1.9)).toBe(1);
});

// test negative numbers too
test.todo("rounds negative numbers down");
```
