Summary
This chapter introduced you to the concept of a test double that can be used to block out unwanted framework behavior. In our case, that was the fetch
call that, at runtime, will be magically hooked up to the API endpoints. But since we don’t have access to the SvelteKit runtime environment within a Vitest unit test, we stubbed it out.
You also learned how a side-by-side implementation is used to keep your test suites on Green while you systematically replace the internals of a function.
The next chapter continues the theme of test doubles with a detailed look at component mocks.