Open yilazius opened 7 years ago
@yilazius I also encountered this problem.I solved it like below:
it('reply with related', function () {
return this.room.user.say('alice', '@hubot hello')
.then(() => new Promise((res) => {
const reply = this.room.reply.bind(this.room);
this.room.reply = (...arg) => {
reply(...arg);
res();
};
}))
.then(() => {
// todo assert
});
});
I think the hubot-test-helper should give an easier way for async test.
I do have a function registered which goes like
and I'm expecting this test to succeed:
Unfortunately room.messages is missing the response by hubot. Note: clock.tick(2) is using sion to mock the system time. To be sure that sion works correctly I added two log statements. Both of them are executed in my expected order:
Help in this matter would be highly appreciated!
Best Sebastian