Skip to content

Commit c5567f6

Browse files
kanongilMarsup
authored andcommitted
Fix regroup() to work after team error
1 parent baadcc8 commit c5567f6

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

lib/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,10 @@ exports.Team = class {
6565

6666
async regroup(options) {
6767

68-
await this.work;
68+
try {
69+
await this.work;
70+
}
71+
catch {}
6972

7073
this._init(options);
7174
}

test/index.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,17 @@ describe('Team', () => {
197197
await expect(team.work).to.reject();
198198
expect(Teamwork.Team._notes(team)).to.be.null();
199199
});
200+
201+
it('regroup works after team error', async () => {
202+
203+
const team = new Teamwork.Team({ meetings: 2, strict: true });
204+
team.attend(new Error('failed'));
205+
206+
const regroup = team.regroup();
207+
208+
await expect(team.work).to.reject('failed');
209+
await expect(regroup).to.not.reject();
210+
});
200211
});
201212

202213
describe('Events', () => {

0 commit comments

Comments
 (0)