Skip to content
LogoLogo

dependencies-on-tests

Category: correctness. Default: error. Fixable: no. Since: 0.1.0.

What it does

Reports a non-test module that imports a test file or a test directory. Test files match *.test.* or *.spec.*. Test directories are test, tests, __tests__ and __mocks__.

Why is this bad?

Test code and its dependencies go into the production bundle, or crash there.

Configure the rule

{
  "rules": {
    "dependencies-on-tests": "warn"
  }
}