(appRef: ApplicationRef, message: string)
| 174 | * Verifies whether a console has a log entry that contains a given message. |
| 175 | */ |
| 176 | export 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. |
no test coverage detected
searching dependent graphs…