August 2017
Beginner
374 pages
10h 41m
English
Because we do not want to initialize the state manually in each test, we can use the beforeEach() helper to reset the state before each test runs:
let state
beforeEach(() => { state = filterReducer(undefined, {})})
test('initial state should be false (no filter)', () => { expect(state).toBe(false)})
Read now
Unlock full access