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

fix test

上级 96b931e1
......@@ -33,9 +33,9 @@ import Wechaty from '../wechaty'
// import { PuppetMock } from '../puppet-mock/'
import {
Contact,
} from '../contact'
// import {
// Contact,
// } from '../contact'
import {
Message,
MessagePayload,
......@@ -263,17 +263,16 @@ test('self()', async t => {
}
sandbox.stub(puppet, 'messagePayload').callsFake(mockMessagePayload)
sandbox.stub((puppet as any as { 'user': Contact }), 'user').value(MOCK_CONTACT)
sandbox.stub((puppet as any as { 'userId': string }), 'userId')
.value(MOCK_CONTACT.id)
const selfMsg = wechaty.Message.createMT('xxx')
await selfMsg.ready()
t.true(selfMsg.self(), 'should identify self message true where message from userId')
sandbox.stub((puppet as any as { 'user': Contact }), 'user').value(
// FIXME: use wechaty.Contact.load()
wechaty.Contact.load('fsadfjas;dlkdjfl;asjflk;sjfl;as'),
)
sandbox.stub((puppet as any as { 'userId': string }), 'userId')
.value('fasdfafasdfsdf')
const otherMsg = wechaty.Message.createMT('xxx')
await otherMsg.ready()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册