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

Function assertYieldsWereCleared

packages/jest-react/src/JestReact.js:29–41  ·  view source on GitHub ↗
(root)

Source from the content-addressed store, hash-verified

27}
28
29function assertYieldsWereCleared(root) {
30 const Scheduler = root._Scheduler;
31 const actualYields = Scheduler.unstable_clearLog();
32 if (actualYields.length !== 0) {
33 const error = Error(
34 'Log of yielded values is not empty. ' +
35 'Call expect(ReactTestRenderer).unstable_toHaveYielded(...) first.',
36 );
37 Error.captureStackTrace(error, assertYieldsWereCleared);
38 throw error;
39 }
40 assertConsoleLogsCleared();
41}
42
43function createJSXElementForTestComparison(type, props) {
44 if (__DEV__) {

Callers 1

Calls 1

assertConsoleLogsClearedFunction · 0.85

Tested by

no test coverage detected