Skip to content

noFocusedTests (not released)

Diagnostic Category: lint/nursery/noFocusedTests

Inspired from: no-focused-tests

Disallow focused tests.

Disabled test are useful when developing and debugging, because it forces the test suite to run only certain tests.

However, in pull/merge request, you usually want to run all the test suite.

describe.only("foo", () => {});
nursery/noFocusedTests.js:1:10 lint/nursery/noFocusedTests  FIXABLE  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

   Don't focus the test.
  
  > 1 │ describe.only("foo", () => {});
            ^^^^
    2 │ 
  
   This is likely a change done during debugging or implementation phases, but it's unlikely what you want in production.
  
   Remove it.
  
   Unsafe fix: Remove focus from test.
  
    1  - describe.only("foo",·()·=>·{});
      1+ describe("foo",·()·=>·{});
    2 2  
  
test.only("foo", () => {});
nursery/noFocusedTests.js:1:6 lint/nursery/noFocusedTests  FIXABLE  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

   Don't focus the test.
  
  > 1 │ test.only("foo", () => {});
        ^^^^
    2 │ 
  
   This is likely a change done during debugging or implementation phases, but it's unlikely what you want in production.
  
   Remove it.
  
   Unsafe fix: Remove focus from test.
  
    1  - test.only("foo",·()·=>·{});
      1+ test("foo",·()·=>·{});
    2 2  
  
test("foo", () => {});