Skip to content

TDD + BDD testing + tools - Playground + Experiments

Notifications You must be signed in to change notification settings

TheRemoteCoder/Unit-Testing-Playground

Repository files navigation

Unit Testing

5 Step Method

  1. Decide tiny aspects and limitations (data requirements, responsibilities)
  2. Define input/output of aspects (data types, structures, results)
  3. Define function signatures (parameters, variants)
  4. Define test case for tiny aspects (including misuse and expected fails)
  5. Write code

JEST API

toStrictEqual // Type + Structure
toBe          // Prim itives, References
toEqual       // Deep/Recursive object equality
toBeTruthy    //
toBeFalsy     //
toBeCloseTo   // Float