I always find Jest-Enzyme test cases starting with a beforeEach
global that resembles like the following:
describe(\'TEST BLOCK\' () => {
let w
Jest documentation recommends beforeEach for tests that consume a particular global state for each test, for example, resetting test data in a database before each test is run.
Note the following case:
If beforeEach is inside a describe block, it runs for each test in the describe block.
Using the same example where we have a database with test data, if your tests do not need the test data reset for each test, you can use beforeAll to run some code once, before any tests run.