React - Deepstash

🚚

React

12 STASHED IDEAS

Structuring Tests

Your tests should be short and ideally test only one thing.

The test in the image is described by the string passed to the it function. Take good care writing the description so that it’s clear what is being tested. Do your best to cover the following:

  1. Given - some precondition
  2. When - some action executed by the function that you’re testing
  3. Then - the expected outcome

This is also known as AAA (Arrange, Act, Assert).

1

STASHED IN:

7

STASHED IN:

0 Comments