# biome nursery/useConsistentTestIt: fix changes program behavior

Internal evidence sheet generated by fixhunt. Not an issue text. A human re-verifies, checks the duplicates
below, and writes the upstream report in their own words following the project's AI policy.

- Tool: biome 2.5.15
- Rule: nursery/useConsistentTestIt (tool labels the fix: safe, this fix reported as safe)
- Oracle: fix-changes-behavior
- Judge (Nemotron 3 Ultra, advisory): real, severity high. The rule assumes `it` and `test` are interchangeable globals provided by the test framework, but the program uses `test` as a local variable (likely an imported or defined function). The fix rewrites the local `test` calls to `it`, which is undefined in this scope, changing a working program into one that throws a ReferenceError.
- Program: minimized from 4 to 1 lines

## Reproducer

```js
[test('a', inc), test('b', inc)].map(([_, fn]) => fn());
```

## Commands

```sh
node prog.js
bunx @biomejs/biome lint --only=nursery/useConsistentTestIt --write prog.js
node prog.js
```

## Observed

```
stderr before: ReferenceError: test is not defined
stderr after: ReferenceError: it is not defined
```

## Diff applied by the fix

```diff
--- orig.js	2026-10-22 13:31:49.071367390 -0400
+++ fixed.js	2026-10-22 13:31:51.115401706 -0400
@@ -1 +1 @@
-[test('a', inc), test('b', inc)].map(([_, fn]) => fn());
+[it('a', inc), it('b', inc)].map(([_, fn]) => fn());
```

## Why the rewrite is not equivalent (model draft, verify before use)

The original program uses `test` as a function; rewriting replaces each call with `it`, which remains undefined in scope. Since both identifiers refer to non-existent functions, the behavior changes from one reference error (`test`) to another (`it`), altering the specific source of failure while preserving only the general class of error (ReferenceError). The substitution does not maintain semantic equivalence because it changes which identifier is accessed, affecting diagnostic output despite identical runtime outcome categories. The fix incorrectly assumes `test` and `it` are interchangeable, but they denote distinct bindings whose absence produces different error messages, violating semantic preservation. This constitutes a behavioral change observable via stderr content, even if both throw ReferenceError. No further assumptions about tooling or context justify the rewrite as safe under language semantics.

## Upstream search

Queries: "useConsistentTestIt fix", "nursery/useConsistentTestIt array destructuring", "useConsistentTestIt function call mapping", "rule nursery/useConsistentTestIt test to it"

- related: https://github.com/biomejs/biome/issues/11453
  Both involve useConsistentTestIt rewriting test to it, but the existing report concerns an imported binding while the new finding uses a bare global call.

<details><summary>All hits</summary>

- [github, closed] useConsistentTestIt: safe fix renames a call whose callee is an imported binding, breaking the import — https://github.com/biomejs/biome/issues/11453
- [github, closed] noMisplacedAssertion: `test.prop(...)` from `@fast-check/vitest` is not recognised as a test function — https://github.com/biomejs/biome/issues/11454
- [github, closed] 💅 `noLeakedRender` false positives — https://github.com/biomejs/biome/issues/10514
- [github, closed] 💅 `useMathMinMax` false positive with Date values — https://github.com/biomejs/biome/issues/10272
- [tavily] 🐛 Internal error/panic in `2.4.11` · Issue #9918 · biomejs/biome · GitHub — https://github.com/biomejs/biome/issues/9918

</details>
