Skip to content

Commit

Permalink
test: assert log payload
Browse files Browse the repository at this point in the history
  • Loading branch information
LayZeeDK committed Oct 25, 2022
1 parent 188486c commit aa1cc03
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import { AppPayload } from './app-payload';
@Injectable({
providedIn: 'root',
})
export class AppLogger extends ScopedLumberjackLogger<AppPayload> {
export class AppLogger extends ScopedLumberjackLogger<AppPayload | undefined> {
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();
}

0 comments on commit aa1cc03

Please sign in to comment.