# Where tests live

A test sits beside the file it tests, in a file named
`<name>.test.jadpo`. There is no folder per kind of test. Here the
`planning` domain's tests sit beside its action, route and schedule, and
one scenario that spans several domains sits in the root `tests/`
folder:

```text
domains/planning/
  actions/     create_todo.jadpo        create_todo.test.jadpo
  routes/      todos.jadpo              todos.test.jadpo
  schedules/   overdue_reminders.jadpo  overdue_reminders.test.jadpo
  fixtures/    alice_with_todos.jadpo
tests/         sign_up_to_first_reminder.test.jadpo
```

A test file holds only `test` declarations.

## A test beside its subject

A test beside the file it tests can call anything in its own domain,
private or not. It sees everything its subject declares without importing
it, and brings in anything else it uses on `use` lines, as any file does
([Imports](imports.md)).

## A scenario in `tests/`

A test that spans several domains, called a scenario, goes in the root
`tests/` folder. It sees only what another domain would see: public
declarations and routes. It imports everything it uses. So unit tests stay
close to their code, and scenarios can't depend on a domain's internals.
