Reference · by task
Test it
Tests beside the code, a real database per test, a controlled clock and provider fakes. Read them in this order. Each page links to the pages around it.
- Where tests live
A test sits beside the file it tests, in a file named
<name>.test.jadpo. - Writing a test
A test is a sentence that names it, then a body of ordinary code.
- Kinds of test
Jadpo works out a test's kind from what it calls, so you don't declare it.
- Acting as a user
An action receives its caller, the person or service signed in, as a typed parameter (The principal).
- Controlling time
A test never waits for real time.
- Fakes for integrations
A test never reaches a real provider, the outside service an integration talks to.
- Assertions
assert conditionfails the test when the condition is false. - Running tests
jadpo testruns every test in the project. - The test database
Each test gets its own database at the latest migration, empty except for what its fixtures create.