From 160bea75478c8a59f79dd879d7d97b34e6ac9926 Mon Sep 17 00:00:00 2001 From: Pratik Fandade Date: Wed, 23 Oct 2024 17:42:41 -0400 Subject: [PATCH] add unit test for coverage --- test/unit/winston/container.test.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/test/unit/winston/container.test.js b/test/unit/winston/container.test.js index 3008ee08b..bbb0aa17c 100644 --- a/test/unit/winston/container.test.js +++ b/test/unit/winston/container.test.js @@ -23,6 +23,29 @@ describe('Container', function () { assume(container.get('default-test')).equals(defaultTest); }); + it('.getAll(default-test)', function () { + container.add('appLogger'); + container.add('serviceLogger'); + + var allLogger = container.getAll(); + var appLogger = container.getAll(/^app/); + var matchLogg = container.getAll(/Logger$/); + var emptyLogg = container.getAll(/Library/); + + assume(allLogger.size).equals(3); + assume(allLogger.has('appLogger')).true(); + assume(allLogger.has('serviceLogger')).true(); + + assume(appLogger.size).equals(1); + assume(appLogger.has('appLogger')).true(); + + assume(matchLogg.size).equals(2); + assume(matchLogg.has('appLogger')).true(); + assume(matchLogg.has('serviceLogger')).true(); + + assume(emptyLogg.size).equals(0); + }); + it('.has(default-test)', function () { assume(container.has('default-test')).true(); });