MCPcopy
hub / github.com/react/react / randomAction

Function randomAction

packages/react-reconciler/src/__tests__/ReactNewContext-test.js:1484–1497  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1482 }
1483
1484 function randomAction() {
1485 switch (randomInteger(0, 3)) {
1486 case 0:
1487 return flushAll();
1488 case 1:
1489 return flush(randomInteger(0, 500));
1490 case 2:
1491 const key = contextKeys[randomInteger(0, contextKeys.length)];
1492 const value = randomInteger(1, 10);
1493 return update(key, value);
1494 default:
1495 throw new Error('Switch statement should be exhaustive');
1496 }
1497 }
1498
1499 function randomActions(n) {
1500 const actions = [];

Callers 1

randomActionsFunction · 0.85

Calls 4

randomIntegerFunction · 0.85
flushAllFunction · 0.85
flushFunction · 0.70
updateFunction · 0.70

Tested by

no test coverage detected