diff --git a/lib/index.js b/lib/index.js index 9e72cf0..6a4e03c 100755 --- a/lib/index.js +++ b/lib/index.js @@ -65,7 +65,10 @@ exports.Team = class { async regroup(options) { - await this.work; + try { + await this.work; + } + catch {} this._init(options); } diff --git a/test/index.js b/test/index.js index cc204fd..05c36cb 100755 --- a/test/index.js +++ b/test/index.js @@ -197,6 +197,17 @@ describe('Team', () => { await expect(team.work).to.reject(); expect(Teamwork.Team._notes(team)).to.be.null(); }); + + it('regroup works after team error', async () => { + + const team = new Teamwork.Team({ meetings: 2, strict: true }); + team.attend(new Error('failed')); + + const regroup = team.regroup(); + + await expect(team.work).to.reject('failed'); + await expect(regroup).to.not.reject(); + }); }); describe('Events', () => {