From 64e9beb42a904eac4cae99fc89996f30a85abbb2 Mon Sep 17 00:00:00 2001 From: bruce Date: Sat, 2 Mar 2024 17:50:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 运行 yarn run test 时失败,原因是 monitor 组件尝试创建连接,在单元测试时并不需要 --- packages/pinus/test/application.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/pinus/test/application.ts b/packages/pinus/test/application.ts index 47d889030..bdc2f20a5 100644 --- a/packages/pinus/test/application.ts +++ b/packages/pinus/test/application.ts @@ -86,6 +86,7 @@ describe('application test', function () { }; app.init({ base: mockBase }); + app.components.__monitor__ = { monitor: null, name: 'mockMonitor', start: () => {}, stop: () => {}, reconnect: () => {} }; app.load(mockComponent); app.start(function (err: Error) { should.not.exist(err); @@ -560,6 +561,7 @@ describe('application test', function () { let count = 0; this.timeout(8888) app.init({ base: mockBase }); + app.components.__monitor__ = { monitor: null, name: 'mockMonitor', start: () => {}, stop: () => {}, reconnect: () => {} }; app.beforeStopHook(function () { count++; });