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

Function testUpdates

packages/react-dom/src/__tests__/ReactUpdates-test.js:614–638  ·  view source on GitHub ↗
(
      components,
      desiredWillUpdates,
      desiredDidUpdates,
    )

Source from the content-addressed store, hash-verified

612 }
613
614 async function testUpdates(
615 components,
616 desiredWillUpdates,
617 desiredDidUpdates,
618 ) {
619 let i;
620
621 await act(() => {
622 for (i = 0; i < components.length; i++) {
623 triggerUpdate(components[i]);
624 }
625 });
626
627 expectUpdates(desiredWillUpdates, desiredDidUpdates);
628
629 // Try them in reverse order
630
631 await act(() => {
632 for (i = components.length - 1; i >= 0; i--) {
633 triggerUpdate(components[i]);
634 }
635 });
636
637 expectUpdates(desiredWillUpdates, desiredDidUpdates);
638 }
639 await testUpdates(
640 [
641 instance.switcherRef.current.boxRef.current,

Callers 1

Calls 3

triggerUpdateFunction · 0.85
expectUpdatesFunction · 0.85
actFunction · 0.70

Tested by

no test coverage detected