From aa1cc0370b1a6d6587a592c79fb3c63a0df40b0e Mon Sep 17 00:00:00 2001 From: Lars Gyrup Brink Nielsen Date: Tue, 25 Oct 2022 13:50:21 +0000 Subject: [PATCH] test: assert log payload --- .../lumberjack-app-e2e/src/integration/console-driver.spec.ts | 4 +++- .../examples/lumberjack-app/src/app/app-logger.service.ts | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/e2e/examples/lumberjack-app-e2e/src/integration/console-driver.spec.ts b/e2e/examples/lumberjack-app-e2e/src/integration/console-driver.spec.ts index 7acef4ff2..6398b2e78 100644 --- a/e2e/examples/lumberjack-app-e2e/src/integration/console-driver.spec.ts +++ b/e2e/examples/lumberjack-app-e2e/src/integration/console-driver.spec.ts @@ -18,6 +18,8 @@ describe('Console log driver', () => { visit(); cy.tick(2000); - cy.get('@consoleError').should('have.been.calledWith', 'critical [Forest App] The forest is on fire!'); + cy.get('@consoleError').should('have.been.calledWith', 'critical [Forest App] The forest is on fire!', { + angularVersion: 14, + }); }); }); diff --git a/packages/examples/lumberjack-app/src/app/app-logger.service.ts b/packages/examples/lumberjack-app/src/app/app-logger.service.ts index 98727a679..a3c16c713 100644 --- a/packages/examples/lumberjack-app/src/app/app-logger.service.ts +++ b/packages/examples/lumberjack-app/src/app/app-logger.service.ts @@ -5,14 +5,14 @@ import { AppPayload } from './app-payload'; @Injectable({ providedIn: 'root', }) -export class AppLogger extends ScopedLumberjackLogger { +export class AppLogger extends ScopedLumberjackLogger { private readonly payload: AppPayload = { angularVersion: VERSION.major, }; scope = 'Forest App'; - forestOnFire = this.createCriticalLogger('The forest is on fire!').withPayload(this.payload).build(); + forestOnFire = this.createCriticalLogger('The forest is on fire!').build(); helloForest = this.createInfoLogger('Hello, Forest!').withPayload(this.payload).build(); }