redline
HighTests and CIfocused-test

Focused test

Focused test. it.only runs only this test. Every other test in the file is silently skipped.

This is how the comment reads inline, under the flagged line.

Why it matters

A committed .only turns a whole suite green by not running it.

What to do

Remove .only.

Examples

Flagged
it.only("saves", () => {});
Better
it("saves", () => {});

What it catches

It reads a pattern on each line, aware of strings and comments. Languages: TypeScript and JavaScript. Scope: Test files only. These cases are the rule's own tests: the first set must be flagged and the second must not.

Flagged

it.only("a", () => { expect(1).toBe(1); });

Left alone

it("a", () => { expect(1).toBe(1); });

Research

`.only`, `fit`, `fdescribe`. A focused test silently turns off every other test in the file.

Turn it off or change it

In a config file for the CLI, or in the API's rules field:

{
  "rules": {
    "disable": [
      "focused-test"
    ],
    "severity": {
      "focused-test": "low"
    }
  }
}

Read the source or report a false positive.