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

Function assertLog

packages/internal-test-utils/ReactInternalTestUtils.js:313–326  ·  view source on GitHub ↗
(expectedLog)

Source from the content-addressed store, hash-verified

311}
312
313export function assertLog(expectedLog) {
314 const actualLog = SchedulerMock.unstable_clearLog();
315 if (equals(actualLog, expectedLog)) {
316 return;
317 }
318
319 const error = new Error(`
320Expected sequence of events did not occur.
321
322${diff(expectedLog, actualLog)}
323`);
324 Error.captureStackTrace(error, assertLog);
325 throw error;
326}
327
328export const assertConsoleLogDev = createLogAssertion(
329 'log',

Calls 1

diffFunction · 0.50

Tested by

no test coverage detected