/** * Prepare the store for use in testing.
*/ function setupStore(preloadedState = {}) { const middleware = [thunk()]; const mockStore = configureStore(middleware); return mockStore(preloadedState);
}
/** * This gives an opportunity to Promises to resolve in tests * (since they are microtasks)
*/
async function flushPromises() {
await new Promise(r => setTimeout(r, 0));
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.