fixhunt

biome nursery/useConsistentTestIt

labelled safe
Runs / 2026-10-17T20-49-46-686Z-qbws-biome-nursery_useConsistentTestItbiome 2.5.152026-10-17 20:49 UTC8 programs × 2 round(s)15 programs, 2 fired, 2 fixed, 2 findings, 2 rejectedmodel cost $0.03

Analysis Nemotron 3 Super

The rule flags inconsistent usage of 'it' vs 'test' keywords for test function calls based on configured preferences.

Fix: Replaces 'test' with 'it' or vice versa according to the rule's function and withinDescribe options, preserving all arguments and formatting while respecting syntactic boundaries.

12 hazards
  • Rewriting 'test' in 'const test = value;' would corrupt a variable declaration by changing the identifier, altering runtime value access.
  • Changing 'test' in 'function test() {}' modifies a function declaration's name, breaking recursive calls or external references to that function.
  • Altering 'test' in an import alias like 'import { test as t }' would mismatch the imported binding, causing undefined reference errors.
  • Modifying 'test' inside a comment or string literal would introduce invalid syntax where none existed, potentially creating accidental identifiers.
  • Renaming 'test' in a dynamic property access like 'obj[test]' would change the evaluated key, leading to incorrect property lookup or runtime errors.
  • Rewriting 'test' when followed by JSX (e.g., 'test<div/>') would corrupt the expression by inserting a JSX element where a function call was expected.
  • Changing 'test' in a template literal like `\(test\)` would alter the literal's content, potentially breaking string interpolation or evaluation.
  • Renaming 'test' in a labeled statement ('test: console.log(1)') would change the label name, breaking any 'break test' or 'continue test' references.
  • Modifying 'test' in an import specifier like 'import { test } from "mod"' without updating the import statement would leave the import unchanged, causing a mismatch between the imported binding and its usage.
  • Rewriting 'test' when it's part of a larger identifier like 'testify' would incorrectly truncate or alter the symbol, causing reference errors.
  • Changing 'test' in a type annotation or JSDoc comment (e.g., '@type {test}') would corrupt documentation semantics without affecting runtime, but could break tooling dependencies.
  • Altering 'test' in a destructuring pattern like '{ test } = obj' would rename the binding, causing subsequent uses of 'test' to reference the wrong variable or be undefined.

Findings

programoraclelabeljudgestatussummary
r2-p003fix-changes-behaviorlabelled safereal · highrelatedThe 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 `i…
r2-p008fix-changes-behaviorlabelled safereal · highrelatedThe rule assumes `it` and `test` are interchangeable globals provided by the test framework, but the program uses `test` as a local variable (likely an importe…

Programs

idresulttitlehazard
r1-p001silentVariable Declaration CorruptionRewriting 'test' in 'const test = value;' would corrupt a variable declaration by changing the identifier, altering runtime value access.
r1-p002silentImport Alias MismatchAltering 'test' in an import alias like 'import { test as t }' would mismatch the imported binding, causing undefined reference errors.
r1-p003silent prediction offGetter/Setter Side Effectsgetters, setters and Object.defineProperty side effects
r1-p004silent prediction offVar Hoisting and Redefinitionvar hoisting and re-declaration inside loops or after use
r1-p005silentLarger Identifier SubstringRewriting 'test' when it's part of a larger identifier like 'testify' would incorrectly truncate or alter the symbol, causing reference errors.
r1-p006silent prediction offTemporal Dead Zonetemporal dead zone after code is hoisted or reordered
r1-p007silentTemplate Literal ContentChanging 'test' in a template literal like `\(test\)' would alter the literal's content, potentially breaking string interpolation or evaluation.
r1-p008silent prediction offDestructuring Binding RenameAltering 'test' in a destructuring pattern like '{ test } = obj' would rename the binding, causing subsequent uses of 'test' to reference the wrong variable or be undefined.
r2-p001invalidClass Fields Interactionclass fields, static blocks, private names, super calls
r2-p003fix-changes-behaviorASI Leading ParenthesisASI and semicolon-less code, leading ( or [ on the next line
r2-p004invalidJSX Corruption HazardRewriting 'test' when followed by JSX (e.g., 'test<div/>') would corrupt the expression by inserting a JSX element where a function call was expected.
r2-p005silentComment/String Literal SafetyModifying 'test' inside a comment or string literal would introduce invalid syntax where none existed, potentially creating accidental identifiers.
r2-p006silentLarger Identifier PartRewriting 'test' when it's part of a larger identifier like 'testify' would incorrectly truncate or alter the symbol, causing reference errors.
r2-p007silent prediction offProto and Prototype Access__proto__ keys, prototype access, Object.assign vs spread
r2-p008fix-changes-behaviorOrder of Evaluation Side Effectsorder of evaluation when expressions are merged, duplicated or deleted (side effects run twice or never)

Sources

r1-p001 · Variable Declaration Corruption
1const test = 42;
2console.log(`Value: ${test}`);
3if (typeof test === 'number') {
4 console.log('TypeOK');
5}
Value: 42
TypeOK
r1-p002 · Import Alias Mismatch
1import { test as runner } from 'assert';
2try {
3 runner.ok(true, 'pass');
4 console.log('Assertion passed');
5} catch (e) {
6 console.log(`Error: ${e.name}`);
7}
r1-p003 · Getter/Setter Side Effects
1const obj = {};
2Object.defineProperty(obj, 'test', {
3 get() { return this._val * 2; },
4 set(v) { this._val = v; }
5});
6obj.test = 5;
7console.log(`Getter result: ${obj.test}`);
Getter result: 10
r1-p004 · Var Hoisting and Redefinition
1for (let i = 0; i < 2; i++) {
2 var test = i * 10;
3 if (i === 0) continue;
4}
5console.log(`Final test: ${test}`);
Final test: 10
r1-p005 · Larger Identifier Substring
1function testify(value) {
2 return `Result: ${value}`;
3}
4console.log(testify(42));
Result: 42
r1-p006 · Temporal Dead Zone
1if (true) {
2 console.log(typeof test);
3 let test = 'initialized';
4 console.log(test);
5}
r1-p007 · Template Literal Content
1const str = `(test)`;
2console.log(`Literal content: ${str}`);
Literal content: (test)
r1-p008 · Destructuring Binding Rename
1const obj = { test: 123 };
2const { test } = obj;
3console.log(`Destructured: ${test}`);
Destructured: 123
r2-p001 · Class Fields Interaction (generated program does not parse: /home/sun/dev/diaghunt/runs/2026-10-17T20-49-4)
1class TestSuite {
2 static #count = 0;
3 static {
4 test('static init', () => { TestSuite.#count++; });
5 }
6 constructor() {
7 test('instance', () => { this.value = TestSuite.#count; });
8 }
9 get value() { return this._value; }
10 set value(v) { this._value = v; }
11}
12const s = new TestSuite();
13console.log(s.value, TestSuite.#count);
r2-p003 · ASI Leading Parenthesis
1let x = 1
2[test('first', () => x++), test('second', () => x++)].forEach(f => f())
3console.log(x)
--- orig.js	2026-10-17 16:50:08.094281251 -0400
+++ fixed.js	2026-10-17 16:50:08.387287016 -0400
@@ -1,3 +1,3 @@
 let x = 1
-[test('first', () => x++), test('second', () => x++)].forEach(f => f())
+[it('first', () => x++), it('second', () => x++)].forEach(f => f())
 console.log(x)
r2-p004 · JSX Corruption Hazard (generated program does not parse: /home/sun/dev/diaghunt/runs/2026-10-17T20-49-4)
1function App() {
2 return (
3 <div>
4 {test<span>hello</span>}
5 </div>
6 );
7}
8// Simulate JSX execution: treat as object creation
9try {
10 const el = { type: 'div', props: { children: [{ type: 'span', props: { children: 'hello' }}] } };
11 console.log('JSX-like structure created:', el.props.children[0].props.children);
12} catch (e) {
13 console.log('Error:', e.name, e.message);
14}
r2-p005 · Comment/String Literal Safety
1console.log('This is a test string');
2// This is a test comment
3const regex = /test/g;
4console.log('string:', 'This is a test string'.match(regex));
This is a test string
string: [ 'test' ]
r2-p006 · Larger Identifier Part
1const testify = () => 42;
2const result = testify();
3console.log('result:', result);
result: 42
r2-p007 · Proto and Prototype Access
1const obj = { test: () => 'original' };
2obj.__proto__.test = () => 'overridden';
3console.log(obj.test());
4const copy = Object.assign({}, obj);
5console.log(copy.test());
original
original
r2-p008 · Order of Evaluation Side Effects
1let counter = 0;
2const inc = () => ++counter;
3[test('a', inc), test('b', inc)].map(([_, fn]) => fn());
4console.log('final counter:', counter);
--- orig.js	2026-10-17 16:50:09.291304797 -0400
+++ fixed.js	2026-10-17 16:50:09.566310203 -0400
@@ -1,4 +1,4 @@
 let counter = 0;
 const inc = () => ++counter;
-[test('a', inc), test('b', inc)].map(([_, fn]) => fn());
+[it('a', inc), it('b', inc)].map(([_, fn]) => fn());
 console.log('final counter:', counter);