MCPcopy
hub / github.com/angular/angular / verifyHasLog

Function verifyHasLog

packages/platform-server/test/hydration_utils.ts:176–184  ·  view source on GitHub ↗
(appRef: ApplicationRef, message: string)

Source from the content-addressed store, hash-verified

174 * Verifies whether a console has a log entry that contains a given message.
175 */
176export function verifyHasLog(appRef: ApplicationRef, message: string) {
177 const console = appRef.injector.get(Console) as DebugConsole;
178 const context =
179 `Expected '${message}' to be present in the log, but it was not found. ` +
180 `Logs content: ${JSON.stringify(console.logs)}`;
181 expect(console.logs.some((log) => log.includes(message)))
182 .withContext(context)
183 .toBe(true);
184}
185
186/**
187 * Verifies that there is no message with a particular content in a console.

Calls 3

withContextMethod · 0.80
someMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…