Skip to content

Commit

Permalink
fix: 修复单元测试
Browse files Browse the repository at this point in the history
运行 yarn run test 时失败,原因是 monitor 组件尝试创建连接,在单元测试时并不需要
  • Loading branch information
bruce48x committed Mar 2, 2024
1 parent 0fa65f2 commit 64e9beb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/pinus/test/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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++;
});
Expand Down

0 comments on commit 64e9beb

Please sign in to comment.