Skip to content

Testing

The testing option enables linting support for test runners, test environments, and testing-oriented utilities.

Install @santi020k/eslint-config-testing alongside the lean basic package before enabling or auto-detecting entries on this page. The full package already includes it.

IntegrationEnumUse It WhenAuto-Detected
VitestTesting.VitestThe project uses Vitest.Yes
PlaywrightTesting.PlaywrightThe project uses Playwright.Yes
JestTesting.JestThe project uses Jest.No
CypressTesting.CypressThe project uses Cypress.No
Testing LibraryTesting.TestingLibraryThe project uses Testing Library.No
Jest DOMTesting.JestDomThe project uses Testing Library with Jest DOM assertions.No
import { defineConfig, Testing } from '@santi020k/eslint-config-basic'
export default await defineConfig({
testing: [Testing.Vitest, Testing.Playwright]
})
  • Testing integrations can be mixed as needed.
  • Detection covers the most common tools, but manual selection is still available for every supported integration.

When both integrations are enabled, Playwright-owned files set testing-library/utils-module to off. This restricts import heuristics that can mistake Playwright locators for Testing Library queries. Actual imports from Testing Library still receive its rules, and unit-test files keep their existing heuristics. Custom query and render settings remain unchanged.

Use testingFiles.playwright when browser tests live outside the conventional e2e, functional, or Playwright directories:

export default await defineConfig({
testing: ['playwright', 'testing-library'],
testingFiles: { playwright: ['tests/browser/**/*.spec.ts'] }
})

Install @santi020k/eslint-config-testing. Pass a local settings override after the options object when a browser suite deliberately re-exports Testing Library utilities and needs a custom testing-library/utils-module value.

Did this page help?

Your answer stays in this browser. Share details on GitHub to help improve the docs.