From 60f6961d91f858f038bc9e2a44d2d585dbbf9251 Mon Sep 17 00:00:00 2001 From: fengmk2 Date: Sun, 21 Jan 2024 00:36:46 +0800 Subject: [PATCH] test: set Logger instance should throw error --- test/index.test.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/index.test.ts b/test/index.test.ts index 7ceeddf..eb67ee8 100644 --- a/test/index.test.ts +++ b/test/index.test.ts @@ -136,5 +136,11 @@ describe('index.test.ts', () => { assert.equal(logs[0], '[😄哈哈] foo \'bar\' 1'); assert.equal(logs[1], 'biz logger here'); }); + + it('should throw error when set Logger instance', () => { + assert.throws(() => { + setCustomLogger('logger', getLogger()); + }, /can\'t set realLogger to Logger instance/); + }); }); });