# 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 globally available aliases, but the program runs in an environment where neither is defined. The fix rewrites `test` to `it`, changing only the name of the missing global, so the runtime error persists with a different identifier. This is a silent semantic change in plausible code because the rule's documentation presents the rewrite as equivalent while the construct (using a test function without a test runner) is legal JavaScript.
- Program: minimized from 3 to 1 lines

## Reproducer

```js
[test('first', () => x++), test('second', () => x++)].forEach(f => f())
```

## 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:42.796262056 -0400
+++ fixed.js	2026-10-22 13:31:44.848296499 -0400
@@ -1 +1 @@
-[test('first', () => x++), test('second', () => x++)].forEach(f => f())
+[it('first', () => x++), it('second', () => x++)].forEach(f => f())
```

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

The original code calls `test` functions; after rewriting to `it`, those identifiers refer to different variables or properties that may be undefined in scope, causing a reference error where none occurred before—or changing which function is invoked if both exist—altering execution flow and observable behavior. Since `test` ≠ `it`, the substitution changes what code runs, violating semantic equivalence. No assumption about scoping or definitions can make this rewrite safe without contextual guarantees. Thus, the fix is not semantics-preserving.

## Upstream search

Queries: "useConsistentTestIt fix", "nursery/useConsistentTestIt test function call", "useConsistentTestIt replace test with it", "biome lint nursery/useConsistentTestIt array map"

- related: https://github.com/biomejs/biome/issues/11453
  same rule but different construct: imported binding vs global identifier
- related: https://github.com/biomejs/biome/pull/9350
  same rule (useConsistentTestIt) but PR introducing the rule, not a defect report
- related: https://github.com/biomejs/biome/pull/9942
  same rule but fix for panic during fix application, not fix-changes-behavior

<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
- [tavily] feat(lint/js): add `useConsistentTestIt` by dyc3 · Pull Request #9350 · biomejs/biome · GitHub — https://github.com/biomejs/biome/pull/9350
- [tavily] fix(useConsistentTestIt): fix panic when applying code fix by dyc3 · Pull Request #9942 · biomejs/biome · GitHub — https://github.com/biomejs/biome/pull/9942
- [tavily] 📎 Implement nursery/noFloatingPromises - typescript-eslint/no-floating-promises · Issue #4956 · biomejs/biome · GitHub — https://github.com/biomejs/biome/issues/4956
- [tavily] feat: no-jsx-props-bind by sgarcialaguna · Pull Request #7410 · biomejs/biome · GitHub — https://github.com/biomejs/biome/pull/7410
- [tavily] 💅 lint/correctness/useExhaustiveDependencies does not consider global variables as necessary dependencies · Issue #8885 · biomejs/biome · GitHub — https://github.com/biomejs/biome/issues/8885
- [tavily] 🐛 double slash removes the adjacent code line · Issue #910 · biomejs/biome-vscode · GitHub — https://github.com/biomejs/biome-vscode/issues/910
- [tavily] ☂️ Tailwind class sorting lint rule · Issue #1274 · biomejs/biome · GitHub — https://github.com/biomejs/biome/issues/1274

</details>
