📓 3.1.0.13 A Note on Testing
You are expected to write tests for all your functions in this section, just as you have in previous sections.
You'll notice that the lesson examples don't include tests. That's intentional — keeping the examples focused on the functional programming concepts themselves. Mixing in Jest setup and test boilerplate would clutter the lessons at a point where there's already a lot of new material to absorb.
This is also a chance to practice something real developers do constantly: apply a tool you already know to an unfamiliar context. You know how to write tests. Functional code is actually easier to test than OOP code because pure functions always return the same output for the same input — no object setup, no shared state, no surprises. The tests themselves won't look much different from what you wrote in Intermediate JavaScript.
If You Need a Refresher
If it's been a while and you need to revisit the setup:
- Shape Tracker — reference project with Jest configured
- Setting Up Jest
- Setting Up Babel
- TDD Review
- Red Green Refactor Workflow