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

add browser unit test

上级 fae9261c
/**
* Wechaty - Wechat for Bot. Connecting ChatBots
*
* Licenst: ISC
* https://github.com/wechaty/wechaty
*
*/
import { test } from 'ava'
import {
// Config
// , log
} from '../config'
import {
Browser
} from './browser'
test.skip('quit()', async t => {
const browser = new Browser()
await browser.driver.init()
t.notThrows(async () => {
try {
await browser.quit()
} catch(e) {
throw e
}
}, 'should throw exception when call quit() on an un-init-ed browser')
t.throws(() => {
throw new Error('test')
}, Error, 'ok')
// browser.state.current('open', false)
// t.notThrows(() => {
// browser.quit()
// }, 'should not throw exception when call quit() on an `inprocess` `open` state browser')
// t.throws(() => {
// browser.quit()
// }, Error, 'should throw exception when call quit() twice on browser')
})
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册