forked from bots-garden/ori
How to run the tests
This guide shows how to run Ori's test suites. It assumes the frontend dependencies are installed (make deps).
Steps
-
From the repository root, run everything:
make testThis runs the Go suite (
go test ./...) followed by the frontend suite (vitest run). Both must end green.The frontend script sets
NODE_OPTIONS=--no-experimental-webstorage: Node 25 ships a built-inlocalStoragewithoutclear()that shadows jsdom's and fails every store test. The flag is known to Node 22 and later, so it is harmless on older runtimes.
Variants
- Backend only:
make test-go— unit tests for every package plus an end-to-end test that compiles the mock agent, spawns it as a real subprocess and drives a real WebSocket client through a full turn. - Frontend only:
make test-ui— reducer, WebSocket client and component tests under jsdom. - With the race detector:
go test -race ./.... - Skipping the end-to-end test (fast feedback):
go test -short ./....
See also
- Where each suite lives and what it covers: explanation: architecture
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
|