From 6a52c2beb60fa2a8e2d110a677653d5f9f632513 Mon Sep 17 00:00:00 2001 From: ssube Date: Fri, 4 Oct 2019 08:27:43 -0500 Subject: [PATCH] fix(tests): cover typeorm log adapter --- test/utils/logger/TestStorageLogger.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/utils/logger/TestStorageLogger.ts b/test/utils/logger/TestStorageLogger.ts index dc176123f..a8ca6843a 100644 --- a/test/utils/logger/TestStorageLogger.ts +++ b/test/utils/logger/TestStorageLogger.ts @@ -68,4 +68,16 @@ describeLeaks('storage logger', async () => { logger.logSchemaBuild('foo'); expect(info).to.have.callCount(1); }); + + itLeaks('should log messages with passed level', async () => { + const { container, module } = await createContainer(); + const info = spy(); + module.bind(INJECT_LOGGER).toInstance(spyLogger({ + info, + })); + + const logger = await container.create(StorageLogger); + logger.log('info', 'foo'); + expect(info).to.have.callCount(1); + }); });