Skip to content

Latest commit

 

History

History
15 lines (8 loc) · 979 Bytes

exercise006.md

File metadata and controls

15 lines (8 loc) · 979 Bytes

Exercises 006

This time we've decided to give you the exciting challenge of writing your own tests. This is a really important skill to practice as generally in industry you will be writing your own tests to ensure code works as expected.

Tests also serve as great documentation to other developers about how your code should behave and the intention of your code. 📝

First, watch the following video:

Writing your own Unit Tests

Then, work through the exercises in a TDD (Test Driven Development) approach of Red -> Green -> Refactor.

⚠️ Be careful to ensure your test cases cover the full range of possible eventualities! For example, if you just test the numbers 2, 3 and 4 for isPrime can you be sure that your function is actually correct?

You've nearly finished these exercises now. 🔥 For the final ones see: Exercises 007 - Docs