Testing
Unit Testing
Unit tests focus on isolated logic — utility classes, model methods, service behavior — without booting a full HTTP server. They run with vitest (npm run test) and live in tests/Unit/.
Basic unit test
No setup required for pure logic tests. Import the code directly:
TypeScript
Unit tests that need the app container
If your code under test reads config, resolves services from the DI container, or hits the database, extend tests/TestCase.ts and boot the app:
TypeScript
Use (test as any).app to access the Application instance when you need to reach the container directly.
Testing jobs without the full app
Unit-test queue jobs by calling handle() directly and registering a Queue on the app container:
TypeScript
Run unit tests
Bash