Skip to content

Guiding Design Principles

Mason edited this page Jan 22, 2020 · 1 revision
  1. 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.
  2. Be Compatible
    • beforeEach and afterEach should behave as expected. This means that all givens accessible in a test will be accessible by ALL beforeEach and afterEach callbacks run for that test, including ones declared outside the immediate scope of the test.
    • All features of the test harness should remain
  3. Self Contained
    • Givens never puts anything on any global scope. everything is contained to the object received from getGiven()
  4. Worse is Better
    • Don't add features unless they help without making code with givens harder to understand
  5. Be Type-safe
    • Give users the opportunity to be as type safe as they want.
Clone this wiki locally