Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
.Veneno.
wechaty
提交
24bf66a3
W
wechaty
项目概览
.Veneno.
/
wechaty
与 Fork 源项目一致
Fork自
wechaty / wechaty
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
W
wechaty
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
24bf66a3
编写于
10月 27, 2016
作者:
Huan (李卓桓)
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
code clean
上级
6ce351b1
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
125 addition
and
118 deletion
+125
-118
package.json
package.json
+1
-1
src/brolog-env.ts
src/brolog-env.ts
+3
-1
src/contact.ts
src/contact.ts
+2
-2
src/io-client.ts
src/io-client.ts
+62
-55
src/io.ts
src/io.ts
+2
-4
src/puppet-web/browser-driver.ts
src/puppet-web/browser-driver.ts
+25
-20
src/puppet-web/puppet-web.ts
src/puppet-web/puppet-web.ts
+25
-29
src/puppet-web/server.ts
src/puppet-web/server.ts
+4
-4
test/puppet-web/puppet-web.spec.ts
test/puppet-web/puppet-web.spec.ts
+1
-1
test/puppet-web/watchdog.spec.ts
test/puppet-web/watchdog.spec.ts
+0
-1
未找到文件。
package.json
浏览文件 @
24bf66a3
...
...
@@ -30,7 +30,7 @@
"test:phantomjs.bak"
:
"cross-env LC_ALL=C WECHATY_LOG=info WECHATY_HEAD=phantomjs ava --timeout=10m
\"
dist/{src,test}/**/*.spec.js
\"
"
,
"test:chrome"
:
"cross-env LC_ALL=C WECHATY_LOG=verbose WECHATY_HEAD=chrome ava --concurrency 0 --ext js --timeout=10m
\"
dist/{src,test}/**/*.spec.js
\"
"
,
"testdev"
:
"cross-env LC_ALL=C WECHATY_LOG=silly ava --ext ts --serial --verbose --fail-fast --timeout=3m"
,
"testdist"
:
"WECHATY_
HEAD=phantomjs ava --ext ts --verbose --fail-fast --timeout=3
m"
,
"testdist"
:
"WECHATY_
LOG=SILLY WECHATY_HEAD=chrome ava --ext ts --verbose --fail-fast --timeout=2
m"
,
"ava"
:
"cross-env LC_ALL=C WECHATY_LOG=verbose ts-node node_modules/.bin/ava
\"
{src,test}/**/*.spec.js
\"
"
,
"start"
:
"ts-node bin/client"
,
"dev"
:
"ts-node dev.ts"
,
...
...
src/brolog-env.ts
浏览文件 @
24bf66a3
...
...
@@ -22,7 +22,9 @@ if (levelRegex.test(level)) {
log
.
silly
(
'
Brolog
'
,
'
WECHATY_LOG set level to %s
'
,
level
)
}
else
{
log
=
new
Brolog
()
log
.
warn
(
'
Brolog
'
,
'
env WECHATY_LOG(%s) must be one of silly|verbose|info|warn|error|silent
'
,
level
)
if
(
level
)
{
log
.
warn
(
'
Brolog
'
,
'
env WECHATY_LOG(%s) must be one of silly|verbose|info|warn|error|silent
'
,
level
)
}
}
export
{
Brolog
}
...
...
src/contact.ts
浏览文件 @
24bf66a3
...
...
@@ -211,9 +211,9 @@ export class Contact implements Sayable {
return
contactList
[
0
]
}
public
static
load
(
id
:
string
):
Contact
|
null
{
public
static
load
(
id
:
string
):
Contact
{
if
(
!
id
||
typeof
id
!==
'
string
'
)
{
return
null
throw
new
Error
(
'
id not found
'
)
}
if
(
!
(
id
in
Contact
.
pool
))
{
...
...
src/io-client.ts
浏览文件 @
24bf66a3
...
...
@@ -24,8 +24,8 @@ import brolog from './brolog-env'
export
class
IoClient
{
private
wechaty
:
Wechaty
|
null
private
io
:
Io
|
null
private
wechaty
:
Wechaty
private
io
:
Io
// XXX keep io `null-able` or not? 20161026
private
state
=
new
StateMonitor
<
'
online
'
,
'
offline
'
>
(
'
IoClient
'
,
'
offline
'
)
...
...
@@ -44,9 +44,19 @@ export class IoClient {
this
.
log
.
error
(
'
IoClient
'
,
e
.
message
)
throw
e
}
this
.
wechaty
=
Wechaty
.
instance
({
profile
:
token
})
this
.
io
=
new
Io
({
wechaty
:
this
.
wechaty
,
token
:
this
.
token
})
}
public
async
init
():
Promise
<
IoClient
>
{
public
async
init
():
Promise
<
void
>
{
this
.
log
.
verbose
(
'
IoClient
'
,
'
init()
'
)
// if (/connecting|disconnecting/.test(this.currentState())) {
...
...
@@ -61,18 +71,12 @@ export class IoClient {
this
.
state
.
target
(
'
online
'
)
this
.
state
.
current
(
'
online
'
,
false
)
this
.
wechaty
=
Wechaty
.
instance
({
profile
:
Config
.
DEFAULT_PROFILE
})
// return co.call(this, function* () {
try
{
this
.
io
=
await
this
.
initIo
()
this
.
wechaty
=
await
this
.
initWechaty
()
await
this
.
initIo
()
await
this
.
initWechaty
()
// this.currentState('connected')
this
.
state
.
current
(
'
online
'
)
return
this
// }).catch(e => {
return
}
catch
(
e
)
{
this
.
log
.
error
(
'
IoClient
'
,
'
init() exception: %s
'
,
e
.
message
)
// this.currentState('disconnected')
...
...
@@ -81,13 +85,14 @@ export class IoClient {
}
}
private
initWechaty
():
Promise
<
Wechaty
>
{
private
async
initWechaty
():
Promise
<
void
>
{
this
.
log
.
verbose
(
'
IoClient
'
,
'
initWechaty()
'
)
// if (this.targetState() !== 'connected') {
if
(
this
.
state
.
target
()
!==
'
online
'
)
{
this
.
log
.
warn
(
'
IoClient
'
,
'
initWechaty() targetState is not `connected`, skipped
'
)
return
Promise
.
resolve
(
this
.
wechaty
)
const
e
=
new
Error
(
'
state.target() is not `online`, skipped
'
)
this
.
log
.
warn
(
'
IoClient
'
,
'
initWechaty() %s
'
,
e
.
message
)
throw
e
}
const
wechaty
=
this
.
wechaty
...
...
@@ -106,7 +111,7 @@ export class IoClient {
.
catch
(
e
=>
this
.
log
.
error
(
'
IoClient
'
,
'
message.ready() %s
'
,
e
))
})
return
wechaty
.
init
()
await
wechaty
.
init
()
.
then
(
_
=>
{
this
.
log
.
verbose
(
'
IoClient
'
,
'
wechaty.init() succ
'
)
return
wechaty
...
...
@@ -116,34 +121,32 @@ export class IoClient {
wechaty
.
quit
()
throw
e
})
return
}
private
initIo
():
Promise
<
Io
>
{
private
async
initIo
():
Promise
<
void
>
{
this
.
log
.
verbose
(
'
IoClient
'
,
'
initIo() with token %s
'
,
this
.
token
)
// if (this.targetState() !== 'connected') {
if
(
this
.
state
.
target
()
!==
'
online
'
)
{
const
e
rrMsg
=
'
initIo() targetState is not `connected`, skipped
'
this
.
log
.
warn
(
'
IoClient
'
,
e
rrMsg
)
return
Promise
.
reject
(
errMsg
)
const
e
=
new
Error
(
'
initIo() targetState is not `connected`, skipped
'
)
this
.
log
.
warn
(
'
IoClient
'
,
e
.
message
)
throw
e
}
if
(
!
this
.
wechaty
)
{
throw
new
Error
(
'
initIo() need a wechaty instance
'
)
}
// const io = this.io = new Io({
// wechaty: this.wechaty
// , token: this.token
// })
const
wechaty
=
this
.
wechaty
const
io
=
this
.
io
const
io
=
new
Io
({
wechaty
,
token
:
this
.
token
})
return
io
.
init
()
await
io
.
init
()
.
catch
(
e
=>
{
this
.
log
.
verbose
(
'
IoClient
'
,
'
initIo() init fail: %s
'
,
e
.
message
)
throw
e
})
return
}
public
initWeb
(
port
=
Config
.
httpPort
)
{
...
...
@@ -184,7 +187,7 @@ export class IoClient {
}
}
public
start
():
Promise
<
IoClient
>
{
public
async
start
():
Promise
<
void
>
{
this
.
log
.
verbose
(
'
IoClient
'
,
'
start()
'
)
if
(
!
this
.
wechaty
)
{
...
...
@@ -202,28 +205,29 @@ export class IoClient {
this
.
state
.
target
(
'
online
'
)
this
.
state
.
current
(
'
online
'
,
false
)
return
this
.
initIo
()
.
then
(
io
=>
{
this
.
io
=
io
// this.currentState('connected')
this
.
state
.
current
(
'
online
'
)
return
this
})
.
catch
(
e
=>
{
this
.
log
.
error
(
'
IoClient
'
,
'
start() exception: %s
'
,
e
.
message
)
// this.currentState('disconnected')
this
.
state
.
current
(
'
offline
'
)
throw
e
})
try
{
await
this
.
initIo
()
// .then(() => {
// // this.io = io
// // this.currentState('connected
')
this
.
state
.
current
(
'
online
'
)
return
}
catch
(
e
)
{
this
.
log
.
error
(
'
IoClient
'
,
'
start() exception: %s
'
,
e
.
message
)
// this.currentState('disconnected')
this
.
state
.
current
(
'
offline
'
)
throw
e
}
}
public
stop
()
{
public
async
stop
():
Promise
<
void
>
{
this
.
log
.
verbose
(
'
IoClient
'
,
'
stop()
'
)
// this.targetState('disconnected')
// this.currentState('disconnecting')
this
.
state
.
target
(
'
offline
'
)
this
.
state
.
current
(
'
offline
'
,
false
)
// XXX
if
(
!
this
.
io
)
{
this
.
log
.
warn
(
'
IoClient
'
,
'
stop() without this.io
'
)
// this.currentState('connected')
...
...
@@ -231,29 +235,30 @@ export class IoClient {
return
Promise
.
resolve
()
}
const
p
=
this
.
io
.
quit
()
await
this
.
io
.
quit
()
// .then(_ => this.currentState('disconnected'))
.
then
(
_
=>
this
.
state
.
current
(
'
offline
'
))
// .then(_ => this.state.current('offline'))
this
.
state
.
current
(
'
offline
'
)
// XXX 20161026
// this.io = null
return
p
return
}
public
async
restart
():
Promise
<
IoClient
>
{
public
async
restart
():
Promise
<
void
>
{
this
.
log
.
verbose
(
'
IoClient
'
,
'
restart()
'
)
// return co.call(this, function* () {
try
{
await
this
.
stop
()
await
this
.
start
()
return
this
// }).catch(e => {
return
}
catch
(
e
)
{
this
.
log
.
error
(
'
IoClient
'
,
'
restart() exception %s
'
,
e
.
message
)
throw
e
}
}
public
async
quit
():
Promise
<
any
>
{
public
async
quit
():
Promise
<
void
>
{
this
.
log
.
verbose
(
'
IoClient
'
,
'
quit()
'
)
// if (this.currentState() === 'disconnecting') {
...
...
@@ -270,17 +275,19 @@ export class IoClient {
try
{
if
(
this
.
wechaty
)
{
await
this
.
wechaty
.
quit
()
this
.
wechaty
=
null
//
this.wechaty = null
}
else
{
this
.
log
.
warn
(
'
IoClient
'
,
'
quit() no this.wechaty
'
)
}
if
(
this
.
io
)
{
await
this
.
io
.
quit
()
this
.
io
=
null
//
this.io = null
}
else
{
this
.
log
.
warn
(
'
IoClient
'
,
'
quit() no this.io
'
)
}
// this.currentState('disconnected')
this
.
state
.
current
(
'
offline
'
)
return
}
catch
(
e
)
{
this
.
log
.
error
(
'
IoClient
'
,
'
exception: %s
'
,
e
.
message
)
...
...
src/io.ts
浏览文件 @
24bf66a3
...
...
@@ -106,7 +106,7 @@ export class Io {
private
connected
()
{
return
this
.
ws
&&
this
.
ws
.
readyState
===
WebSocket
.
OPEN
}
public
async
init
():
Promise
<
Io
>
{
public
async
init
():
Promise
<
void
>
{
log
.
verbose
(
'
Io
'
,
'
init()
'
)
// this.targetState('connected')
...
...
@@ -114,7 +114,6 @@ export class Io {
this
.
state
.
target
(
'
online
'
)
this
.
state
.
current
(
'
online
'
,
false
)
// return co.call(this, function* () {
try
{
await
this
.
initEventHook
()
await
this
.
initWebSocket
()
...
...
@@ -122,8 +121,7 @@ export class Io {
// this.currentState('connected')
this
.
state
.
current
(
'
online
'
)
return
this
// }).catch(e => {
return
}
catch
(
e
)
{
log
.
warn
(
'
Io
'
,
'
init() exception: %s
'
,
e
.
message
)
// this.currentState('disconnected')
...
...
src/puppet-web/browser-driver.ts
浏览文件 @
24bf66a3
...
...
@@ -97,31 +97,36 @@ export class BrowserDriver {
const
customChrome
=
Capabilities
.
chrome
()
.
set
(
'
chromeOptions
'
,
options
)
return
new
Builder
()
.
setAlertBehavior
(
'
ignore
'
)
.
forBrowser
(
'
chrome
'
)
.
withCapabilities
(
customChrome
)
.
build
()
/**
* XXX when will Builder().build() throw exception???
*/
let
driver
let
ttl
=
3
let
err
while
(
!
driver
&&
ttl
--
)
{
try
{
driver
=
new
Builder
()
.
setAlertBehavior
(
'
ignore
'
)
.
forBrowser
(
'
chrome
'
)
.
withCapabilities
(
customChrome
)
.
build
()
}
catch
(
e
)
{
log
.
warn
(
'
PuppetWebBrowserDriver
'
,
'
getChromeDriver() exception: %s, retry ttl: %d
'
,
e
.
message
,
ttl
)
err
=
e
}
}
//
let driver
//
let ttl = 3
//
let err
//
while (!driver && ttl--) {
//
try {
//
driver = new Builder()
//
.setAlertBehavior('ignore')
//
.forBrowser('chrome')
//
.withCapabilities(customChrome)
//
.build()
//
} catch (e) {
//
log.warn('PuppetWebBrowserDriver', 'getChromeDriver() exception: %s, retry ttl: %d', e.message, ttl)
//
err = e
//
}
//
}
if
(
driver
)
{
return
driver
}
//
if (driver) {
//
return driver
//
}
throw
err
//
throw err
}
private
getPhantomJsDriver
():
WebDriver
{
...
...
src/puppet-web/puppet-web.ts
浏览文件 @
24bf66a3
...
...
@@ -65,7 +65,7 @@ export class PuppetWeb extends Puppet {
public
toString
()
{
return
`Class PuppetWeb({browser:
${
this
.
browser
}
,port:
${
this
.
port
}
})`
}
public
async
init
():
Promise
<
this
>
{
public
async
init
():
Promise
<
void
>
{
log
.
verbose
(
'
PuppetWeb
'
,
`init() with head:
${
this
.
setting
.
head
}
, profile:
${
this
.
setting
.
profile
}
`
)
// this.targetState('live')
...
...
@@ -100,7 +100,7 @@ export class PuppetWeb extends Puppet {
log
.
verbose
(
'
PuppetWeb
'
,
'
init() done
'
)
// this.currentState('live')
this
.
state
.
current
(
'
live
'
)
return
this
// for Chaining
return
}
catch
(
e
)
{
log
.
error
(
'
PuppetWeb
'
,
'
init() exception: %s
'
,
e
.
stack
)
...
...
@@ -182,14 +182,12 @@ export class PuppetWeb extends Puppet {
public
async
initBrowser
():
Promise
<
void
>
{
log
.
verbose
(
'
PuppetWeb
'
,
'
initBrowser()
'
)
const
browser
=
new
Browser
({
this
.
browser
=
new
Browser
({
head
:
<
HeadName
>
this
.
setting
.
head
,
sessionFile
:
this
.
setting
.
profile
})
browser
.
on
(
'
dead
'
,
Event
.
onBrowserDead
.
bind
(
this
))
this
.
browser
=
browser
this
.
browser
.
on
(
'
dead
'
,
Event
.
onBrowserDead
.
bind
(
this
))
// if (this.targetState() !== 'live') {
if
(
this
.
state
.
target
()
!==
'
live
'
)
{
...
...
@@ -199,7 +197,7 @@ export class PuppetWeb extends Puppet {
}
try
{
await
browser
.
init
()
await
this
.
browser
.
init
()
}
catch
(
e
)
{
log
.
error
(
'
PuppetWeb
'
,
'
initBrowser() exception: %s
'
,
e
.
message
)
throw
e
...
...
@@ -209,13 +207,11 @@ export class PuppetWeb extends Puppet {
public
async
initBridge
():
Promise
<
void
>
{
log
.
verbose
(
'
PuppetWeb
'
,
'
initBridge()
'
)
const
bridge
=
new
Bridge
(
this
.
bridge
=
new
Bridge
(
this
// use puppet instead of browser, is because browser might change(die) duaring run time
,
this
.
port
)
this
.
bridge
=
bridge
// if (this.targetState() !== 'live') {
if
(
this
.
state
.
target
()
!==
'
live
'
)
{
const
errMsg
=
'
initBridge() found targetState != live, no init anymore
'
...
...
@@ -224,7 +220,7 @@ export class PuppetWeb extends Puppet {
}
try
{
await
bridge
.
init
()
await
this
.
bridge
.
init
()
}
catch
(
e
)
{
if
(
!
this
.
browser
)
{
log
.
warn
(
'
PuppetWeb
'
,
'
initBridge() without browser?
'
)
...
...
@@ -240,12 +236,12 @@ export class PuppetWeb extends Puppet {
private
async
initServer
():
Promise
<
void
>
{
log
.
verbose
(
'
PuppetWeb
'
,
'
initServer()
'
)
const
server
=
new
Server
(
this
.
port
)
this
.
server
=
new
Server
(
this
.
port
)
server
.
on
(
'
scan
'
,
Event
.
onServerScan
.
bind
(
this
))
server
.
on
(
'
login
'
,
Event
.
onServerLogin
.
bind
(
this
))
server
.
on
(
'
logout
'
,
Event
.
onServerLogout
.
bind
(
this
))
server
.
on
(
'
message
'
,
Event
.
onServerMessage
.
bind
(
this
))
this
.
server
.
on
(
'
scan
'
,
Event
.
onServerScan
.
bind
(
this
))
this
.
server
.
on
(
'
login
'
,
Event
.
onServerLogin
.
bind
(
this
))
this
.
server
.
on
(
'
logout
'
,
Event
.
onServerLogout
.
bind
(
this
))
this
.
server
.
on
(
'
message
'
,
Event
.
onServerMessage
.
bind
(
this
))
/**
* @depreciated 20160825 zixia
...
...
@@ -254,12 +250,10 @@ export class PuppetWeb extends Puppet {
*/
// server.on('unload' , Event.onServerUnload.bind(this))
server
.
on
(
'
connection
'
,
Event
.
onServerConnection
.
bind
(
this
))
server
.
on
(
'
disconnect
'
,
Event
.
onServerDisconnect
.
bind
(
this
))
server
.
on
(
'
log
'
,
Event
.
onServerLog
.
bind
(
this
))
server
.
on
(
'
ding
'
,
Event
.
onServerDing
.
bind
(
this
))
this
.
server
=
server
this
.
server
.
on
(
'
connection
'
,
Event
.
onServerConnection
.
bind
(
this
))
this
.
server
.
on
(
'
disconnect
'
,
Event
.
onServerDisconnect
.
bind
(
this
))
this
.
server
.
on
(
'
log
'
,
Event
.
onServerLog
.
bind
(
this
))
this
.
server
.
on
(
'
ding
'
,
Event
.
onServerDing
.
bind
(
this
))
// if (this.targetState() !== 'live') {
if
(
this
.
state
.
target
()
!==
'
live
'
)
{
...
...
@@ -268,7 +262,7 @@ export class PuppetWeb extends Puppet {
return
Promise
.
reject
(
errMsg
)
}
await
server
.
init
()
await
this
.
server
.
init
()
.
catch
(
e
=>
{
log
.
error
(
'
PuppetWeb
'
,
'
initServer() exception: %s
'
,
e
.
message
)
throw
e
...
...
@@ -304,7 +298,7 @@ export class PuppetWeb extends Puppet {
return
this
.
userId
===
message
.
from
().
id
}
public
send
(
message
:
Message
)
{
public
async
send
(
message
:
Message
):
Promise
<
void
>
{
const
to
=
message
.
to
()
const
room
=
message
.
room
()
...
...
@@ -327,23 +321,25 @@ export class PuppetWeb extends Puppet {
,
room
?
room
.
topic
()
:
(
to
as
Contact
).
name
()
,
content
)
return
this
.
bridge
.
send
(
destination
.
id
,
content
)
await
this
.
bridge
.
send
(
destination
.
id
,
content
)
.
catch
(
e
=>
{
log
.
error
(
'
PuppetWeb
'
,
'
send() exception: %s
'
,
e
.
message
)
throw
e
})
}
return
}
/**
* Bot say...
* send to `filehelper` for notice / log
*/
public
say
(
content
:
string
)
{
public
async
say
(
content
:
string
):
Promise
<
void
>
{
const
m
=
new
Message
()
m
.
to
(
'
filehelper
'
)
m
.
content
(
content
)
return
this
.
send
(
m
)
await
this
.
send
(
m
)
return
}
// @deprecated
...
...
@@ -378,7 +374,7 @@ export class PuppetWeb extends Puppet {
throw
e
})
}
public
logined
()
{
return
!!
(
this
.
user
)
}
public
logined
()
:
boolean
{
return
!!
(
this
.
user
)
}
public
ding
(
data
?:
any
):
Promise
<
string
>
{
if
(
!
this
.
bridge
)
{
return
Promise
.
reject
(
new
Error
(
'
ding fail: no bridge(yet)!
'
))
...
...
src/puppet-web/server.ts
浏览文件 @
24bf66a3
...
...
@@ -39,7 +39,7 @@ export class Server extends EventEmitter {
public
toString
()
{
return
`Server({port:
${
this
.
port
}
})`
}
public
async
init
():
Promise
<
Server
>
{
public
async
init
():
Promise
<
void
>
{
log
.
verbose
(
'
PuppetWebServer
'
,
`init() on port
${
this
.
port
}
`
)
// return new Promise((resolve, reject) => {
...
...
@@ -51,7 +51,7 @@ export class Server extends EventEmitter {
this
.
socketServer
=
this
.
createSocketIo
(
this
.
httpsServer
)
log
.
verbose
(
'
PuppetWebServer
'
,
'
init()-ed
'
)
return
this
return
}
catch
(
e
)
{
// .catch(e => {
log
.
error
(
'
PuppetWebServer
'
,
'
init() exception: %s
'
,
e
.
message
)
...
...
@@ -162,7 +162,7 @@ export class Server extends EventEmitter {
return
}
public
quit
():
Promise
<
any
>
{
public
async
quit
():
Promise
<
void
>
{
log
.
verbose
(
'
PuppetWebServer
'
,
'
quit()
'
)
if
(
this
.
socketServer
)
{
log
.
verbose
(
'
PuppetWebServer
'
,
'
closing socketServer
'
)
...
...
@@ -178,7 +178,7 @@ export class Server extends EventEmitter {
this
.
httpsServer
.
close
()
this
.
httpsServer
=
null
}
return
Promise
.
resolve
()
return
}
}
...
...
test/puppet-web/puppet-web.spec.ts
浏览文件 @
24bf66a3
...
...
@@ -56,7 +56,7 @@ test.serial('PuppetWeb login/logout events', async t => {
await
pw
.
quit
()
})
test
.
serial
(
'
PuppetWeb server/browser communication
'
,
async
t
=>
{
test
.
only
(
'
PuppetWeb server/browser communication
'
,
async
t
=>
{
let
pw
=
new
PuppetWeb
()
t
.
truthy
(
pw
,
'
should instantiated a PuppetWeb
'
)
...
...
test/puppet-web/watchdog.spec.ts
浏览文件 @
24bf66a3
...
...
@@ -70,7 +70,6 @@ test('Puppet Web watchdog timer', async t => {
try
{
const
r
=
await
pw
.
ding
(
data
)
// .then(r => {
if
(
!
r
)
{
throw
new
Error
(
'
got empty return
'
)
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录