tests-live-in-tests-dir
| Field | Value |
|---|---|
| Tool | Dependency Cruiser |
| Enable via | layout({ scope }) |
| Severity | error |
| Kind | module rule (reports the file) |
| Source | packages/rules/src/dependency-cruiser.cjs |
| Docs | packages/rules/docs/dependency-cruiser.md |
What it catches
Section titled “What it catches”Test files outside tests/ folders.
As layout({ scope: "@hosti/" }) builds it
Section titled “As layout({ scope: "@hosti/" }) builds it”{ "name": "tests-live-in-tests-dir", "severity": "error", "module": { "path": "^(?:apps|packages)/[^/]+/.*[.](?:test|spec)[.][^/]+$", "pathNot": "^(?:apps|packages)/[^/]+/src/(?:tests|.*/tests)/[^/]+[.](?:test|spec)[.][^/]+$", "numberOfDependentsLessThan": 100 }, "from": {}}This rule is one of several in the Dependency Cruiser preset. The Dependency Cruiser page carries the full preset docs from packages/rules/docs/dependency-cruiser.md.