TestingLogger
The TestingLogger can be used in unit tests or e2e tests to make assertions on whether the various Logger methods have been called, and which arguments.
Here's some examples of how to use it in e2e tests and unit tests. In both cases we are using
the Jest testing framework, but the TestingLogger should work with other similar frameworks
(e.g. replacing jest.fn() with jasmine.createSpy()).
Example
Example
- Implements:
VendureLogger
constructor
method
(createSpyFn: () => Spy) => TestingLoggerdebugSpy
property
SpyerrorSpy
property
SpyinfoSpy
property
SpyverboseSpy
property
SpywarnSpy
property
Spydebug
method
(message: string, context?: string) => voiderror
method
(message: string, context?: string, trace?: string) => voidinfo
method
(message: string, context?: string) => voidverbose
method
(message: string, context?: string) => voidwarn
method
(message: string, context?: string) => voidWas this chapter helpful?