Module 09 Activity
Scenario
Build the suite that runs on every save.
What you build
An offline test suite covering the contract, with fixtures that isolate and the expensive dependency overridden.
Steps
- Write contract tests with
TestClientcovering the success path and every error status you declared. - Write fixtures that reset shared state, and prove two tests do not interact.
- Override the expensive dependency and confirm the real one is never built. Clear the override afterwards.
- Replace exact-response assertions with contract assertions, including one that no unexpected field is present.
- Split the suite into offline and networked groups and report the count and wall clock of each.
- Confirm the offline group passes with no key and runs in seconds.
Evidence to hand in
- Contract tests for the success path and every error.
- The isolation proof.
- The build count for the real dependency.
- The contract assertions including the no-extras check.
- The offline/networked split with timings.
Review checklist
- Every declared error status has a test.
- Fixtures reset shared state and overrides are cleared.
- No assertion depends on an exact response body.
- There is a test that no unexpected field is returned.
- The offline group passes with no key, in seconds.
