提交 b6f624eb 编写于 作者: Huan (李卓桓)'s avatar Huan (李卓桓)

0.20.2 for mock

上级 df37cf31
......@@ -100,7 +100,7 @@
"state-switch": "^0.9.9",
"watchdog": "^0.8.17",
"wechaty-puppet": "^0.24.0",
"wechaty-puppet-hostie": "^0.5.10",
"wechaty-puppet-hostie": "^0.6.1",
"ws": "^7.2.3"
},
"devDependencies": {
......@@ -133,7 +133,7 @@
"sloc": "^0.2.1",
"tstest": "^0.4.10",
"typedoc": "^0.16.11",
"wechaty-puppet-mock": "^0.19.0"
"wechaty-puppet-mock": "^0.20.2"
},
"files_comment__whitelist_npm_publish": "http://stackoverflow.com/a/8617868/1123955",
"files": [
......
......@@ -58,7 +58,7 @@ export class IoClient {
options.token
)
this.state = new StateSwitch('IoClient', log)
this.state = new StateSwitch('IoClient', { log })
}
private async startHostie () {
......@@ -91,10 +91,10 @@ export class IoClient {
public async start (): Promise<void> {
log.verbose('IoClient', 'start()')
if (this.state.pending()) {
log.warn('IoClient', 'start() with a pending state, not the time')
const e = new Error('state.pending() when start()')
throw e
if (this.state.on()) {
log.warn('IoClient', 'start() with a on state, wait and return')
await this.state.ready('on')
return
}
this.state.on('pending')
......
......@@ -81,7 +81,7 @@ export class Io {
private eventBuffer : IoEvent[] = []
private ws : undefined | WebSocket
private readonly state = new StateSwitch('Io', log)
private readonly state = new StateSwitch('Io', { log })
private reconnectTimer? : NodeJS.Timer
private reconnectTimeout? : number
......
......@@ -12,8 +12,8 @@ export const PUPPET_DEPENDENCIES = {
/**
* Wechaty Internal Puppets: dependenced by package.json
*/
'wechaty-puppet-hostie' : '^0.5.10', // https://www.npmjs.com/package/wechaty-puppet-hostie
'wechaty-puppet-mock' : '^0.19.0', // https://www.npmjs.com/package/wechaty-puppet-mock
'wechaty-puppet-hostie' : '^0.6.1', // https://www.npmjs.com/package/wechaty-puppet-hostie
'wechaty-puppet-mock' : '^0.20.2', // https://www.npmjs.com/package/wechaty-puppet-mock
/**
* Wechaty External Puppets
......
......@@ -258,8 +258,8 @@ export class Wechaty extends EventEmitter implements Sayable {
this.id = cuid()
this.state = new StateSwitch('Wechaty', log)
this.readyState = new StateSwitch('WechatyReady', log)
this.state = new StateSwitch('Wechaty', { log })
this.readyState = new StateSwitch('WechatyReady', { log })
/**
* @ignore
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册