test-files-indentation.s

Why

Standardizing the indentation of a test file saves the developer 30 seconds per new function to test.

Checks

There are 2 cases:

Case 1: The tested file exports at least 1 named function

Use the following indentation even if only one function is tested:

  • 1 describe per file

    • 1 describe per function

    • 1 it for each case

Case 2: The tested file exports only 1 function or element as default

Use the following indentation:

  • 1 describe with the name of the file

    • 1 it for each functionality

Good examples

Case 1: Generic example

Case 1: A saga test with redux-saga-test-plan

Case 2: A react-native component

Bad examples // @TODO

Last updated