E1143: test file or directory in the wrong place
Tests live in two places (ADR-0121).
Tests live in two places (ADR-0121). The tests of a module are .act files
directly in the tests directory next to its facade, as in
src/math/tests/. The tests of the project are .act files directly in
tests/. The compiler reports the path that is in the wrong place, with no line and
column. It rejects:
- a
testsdirectory with a facadetests.act, because atestsdirectory is never a module; - a
src/testsdirectory, because the root unit has no tests directory; - a subdirectory inside a
testsdirectory, except one namedfixturesorsnapshots, which holds test data; - an
.actfile in a subdirectory oftests/, the old layout that mirrored a source path.
The message names the directory or file and tells where it belongs.
Example
actus
actus
actus
actus
actus
actus
actus
actus
Fix
Put the test file directly in the tests directory of its module.
actus
actus
actus
actus
Run actus explain E1143 in your terminal to read this entry offline. Browse Modules & rules or all error codes.