May 2019
Intermediate to advanced
496 pages
10h 38m
English
The first step is to build the middleware that works with local storage:
import { save } from '../../src/middleware/localStorage';describe('localStorage', () => { const data = { a: 123 }; let getItemSpy = jest.fn(); let setItemSpy = jest.fn(); beforeEach(() => { Object.defineProperty(window, 'localStorage', { value: { getItem: getItemSpy, setItem: setItemSpy }}); });});
Read now
Unlock full access