-
Notifications
You must be signed in to change notification settings - Fork 1
Guiding Design Principles
Mason edited this page Jan 22, 2020
·
1 revision
- Be Predictable
- Glancing at the test code should be enough to determine which callbacks givens will use to evaluate a specific given value in a specific test.
- You should never be surprised by a cached value being reset.
- Be Compatible
-
beforeEach
andafterEach
should behave as expected. This means that all givens accessible in a test will be accessible by ALLbeforeEach
andafterEach
callbacks run for that test, including ones declared outside the immediate scope of the test. - All features of the test harness should remain
-
- Self Contained
- Givens never puts anything on any global scope. everything is contained to the object received from
getGiven()
- Givens never puts anything on any global scope. everything is contained to the object received from
-
Worse is Better
- Don't add features unless they help without making code with givens harder to understand
- Be Type-safe
- Give users the opportunity to be as type safe as they want.