12. Testing with UniTest
Coming soon
This chapter is an outline. The full draft ships in a follow-up PR.
What this chapter will cover
Tests in a Uni codebase favor the real implementation with narrow substitutions, rather than deep mocking. This chapter covers the shape of a UniTest suite and how Design makes substitutions clean.
Concepts introduced:
- The
UniTestbase class and the assertion vocabulary (shouldBe,shouldContain,shouldMatch). - Why the project avoids mocks, and what to do instead: narrow overrides via
Designand in-process fakes. - Property-based testing primitives.
- Async tests with
RxandFuture. - Cross-platform tests: writing one suite that runs under JVM, Scala.js, and Scala Native.
- Speed: keeping a Uni test suite under a second, and why that matters.
Reference you can read now
← 11. Building LLM Agents | Next → Appendix A: Scala 3 Syntax Notes
