Skip to content

noIdenticalTestTitle

biome.json
{
"linter": {
"rules": {
"nursery": {
"noIdenticalTestTitle": "error"
}
}
}
}

Disallow identical titles in test suites and test cases.

Having identical titles for two different tests or test suites at the same level may create confusion. For example, when a test fails it is hard to tell which test exactly failed based on its title alone.

it('should do bar', () => {});
it('should do bar', () => {});
code-block.js:2:1 lint/nursery/noIdenticalTestTitle ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Duplicate test title found.

1 │ it(‘should do bar’, () => {});
> 2 │ it(‘should do bar’, () => {});
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3 │

A test with this title already exists in the same scope.

Rename the test to give it a unique, descriptive title.

This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.

describe('foo', () => {
it('should do bar', () => {});
it('should do bar', () => {});
});
code-block.js:3:3 lint/nursery/noIdenticalTestTitle ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Duplicate test title found.

1 │ describe(‘foo’, () => {
2 │ it(‘should do bar’, () => {});
> 3 │ it(‘should do bar’, () => {});
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 │ });
5 │

A test with this title already exists in the same scope.

Rename the test to give it a unique, descriptive title.

This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.

describe('foo', () => {});
describe('foo', () => {});
code-block.js:2:1 lint/nursery/noIdenticalTestTitle ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Duplicate describe title found.

1 │ describe(‘foo’, () => {});
> 2 │ describe(‘foo’, () => {});
^^^^^^^^^^^^^^^^^^^^^^^^^
3 │

A describe with this title already exists in the same scope.

Rename the describe to give it a unique, descriptive title.

This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.

describe('foo', () => {
describe('baz', () => {});
describe('baz', () => {});
});
code-block.js:3:3 lint/nursery/noIdenticalTestTitle ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Duplicate describe title found.

1 │ describe(‘foo’, () => {
2 │ describe(‘baz’, () => {});
> 3 │ describe(‘baz’, () => {});
^^^^^^^^^^^^^^^^^^^^^^^^^
4 │ });
5 │

A describe with this title already exists in the same scope.

Rename the describe to give it a unique, descriptive title.

This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.

describe('foo', () => {
it('should do foo', () => {});
it('should do bar', () => {});
});
describe('bar', () => {});
describe('foo', () => {
describe('baz', () => {
it('should work', () => {});
});
describe('bar', () => {
it('should work', () => {});
});
});