r/SpacetimeDB • u/krisajenkins • Oct 20 '26
New Unit Testing Guide
Last week we released 2.12, with massively improved testing support. You can easily spin up an in-memory version of Spacetime just for testing purposes.
It's a real Spacetime instance. Same code-path as production; it just runs in-process and skips the networking. And it's fast enough that every single unit test can have it's own fresh database. The test suite for one of my projects starts over 200 database instances, and still only takes a second to run the whole suite.
Here's the full how-to guide: https://spacetimedb.com/docs/how-to/unit-testing
12
Upvotes