MCPcopy
hub / github.com/facebook/react / sleep

Function sleep

packages/react-dom/src/__tests__/ReactTestUtilsAct-test.js:22–28  ·  view source on GitHub ↗
(period)

Source from the content-addressed store, hash-verified

20global.IS_REACT_ACT_ENVIRONMENT = true;
21
22function sleep(period) {
23 return new Promise(resolve => {
24 setTimeout(() => {
25 resolve(true);
26 }, period);
27 });
28}
29
30describe('React.act()', () => {
31 afterEach(() => {

Callers 2

AppFunction · 0.70

Calls 1

resolveFunction · 0.70

Tested by

no test coverage detected