Skip to content

Commit

Permalink
Merge branch 'fix/check-ready-after-login'
Browse files Browse the repository at this point in the history
  • Loading branch information
hcfw007 committed Dec 21, 2023
2 parents 826b81c + 91a8a64 commit 5f16d07
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/wechaty/wechaty-base.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,18 +260,18 @@ test('@event ready', async t => {
await new Promise(resolve => {
setTimeout(resolve, 16 * 1000)
})
t.equal(spy.callCount, 1, 'should fire ready event after puppet ready')
t.ok(spy.called, 'should fire ready event after puppet ready')

await wechaty.stop()
await wechaty.start()
t.equal(spy.callCount, 1, 'should fire ready event second time after stop/start wechaty')
t.ok(spy.called, 'should fire ready event second time after stop/start wechaty')

await puppet.mocker.login(mockContact)
puppet.emit('ready', { data: 'test' })
await new Promise(resolve => {
setTimeout(resolve, 16 * 1000)
})
t.equal(spy.callCount, 2, 'should fire ready event third time after stop/start wechaty')
t.ok(spy.called, 'should fire ready event third time after stop/start wechaty')

await wechaty.stop()
})
Expand Down

0 comments on commit 5f16d07

Please sign in to comment.