Test Your Functional Core
In this chapter, we’ve been busy. We’ve tested our functional core from end to end. Here’s how we did it.
We started with setup functions to build our test data. Since our quiz is a complex model with many complex transitions, we needed some functions to let us quickly set up quizzes to simulate a variety of conditions. We used simple functions, and paid careful attention to composition. We also gave our functions the ability to override defaults.
Once we had those functions, we used them in named setups. Those functions are small composable purpose-built testing functions that layer complexity for tests. We tested templates, questions, and responses in this way.
Once we moved to the QuizTest, we needed more help. We ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access