jest/no-identical-title
eslint-plugin-jest
No autofixRecommended
eslint.config.js
import jest from "eslint-plugin-jest";
export default [
{
plugins: { jest },
rules: {
"jest/no-identical-title": "error",
},
},
];it('should do bar', () => {});
it('should do bar', () => {});describe('foo', () => {
it('should do bar', () => {});
it('should do bar', () => {});
});describe('foo', () => {});
describe('foo', () => {});describe('foo', () => {
it('should do foo', () => {});
it('should do bar', () => {});
});
describe('bar', () => {});describe('foo', () => {
describe('baz', () => {
it('should work', () => {});
});
describe('bar', () => {
it('should work', () => {});
});
});Examples from the Biome documentation.
jest/no-identical-title
eslint-plugin-jest
import jest from "eslint-plugin-jest";
export default [
{
plugins: { jest },
rules: {
"jest/no-identical-title": "error",
},
},
];jest/no-identical-title
jest plugin · style
{
"plugins": [
"jest"
],
"rules": {
"jest/no-identical-title": "error"
}
}suspicious/noIdenticalTestTitle
suspicious · since 2.4.12
{
"linter": {
"rules": {
"suspicious": {
"noIdenticalTestTitle": "error"
}
}
}
}Disallow using exports in files containing tests
Disallow duplicate setup and teardown hooks
Disallow explicitly returning from tests