jest/no-focused-tests
eslint-plugin-jest
SuggestionRecommended
eslint.config.js
import jest from "eslint-plugin-jest";
export default [
{
plugins: { jest },
rules: {
"jest/no-focused-tests": "error",
},
},
];describe.only("foo", () => {});test.only("foo", () => {});test.only.each([["a"]])("%s", (a) => {});test("foo", () => {});test.each([["a"]])("%s", (a) => {});Examples from the Biome documentation.
jest/no-focused-tests
eslint-plugin-jest
import jest from "eslint-plugin-jest";
export default [
{
plugins: { jest },
rules: {
"jest/no-focused-tests": "error",
},
},
];jest/no-focused-tests
jest plugin · correctness
{
"plugins": [
"jest"
],
"rules": {
"jest/no-focused-tests": "error"
}
}suspicious/noFocusedTests
suspicious · since 1.6.0
{
"linter": {
"rules": {
"suspicious": {
"noFocusedTests": "error"
}
}
}
}Disallow using exports in files containing tests
Disallow duplicate setup and teardown hooks
Disallow explicitly returning from tests