提交 36d04d2d 编写于 作者: L lijiarui 提交者: Huan (李卓桓)

fix room test (#328)

* fix room test

* fix room.alias() test unit
上级 e0796e84
......@@ -116,7 +116,7 @@ test('Room smoking test', async t => {
const contact2 = new Contact(EXPECTED.memberId2)
const nick2 = r.nick(contact2)
t.is(nick2, EXPECTED.memberNick2, 'should get name if not set roomAlias')
t.is(nick2, null, 'should return null if not set roomAlias')
const name2 = r.alias(contact2)
t.is(name2, null, 'should return null if not set roomAlias')
......@@ -157,8 +157,8 @@ test('Room smoking test', async t => {
test('Room static method', async t => {
try {
await Room.find({ topic: 'xxx' })
t.fail('should throw but not')
const result = await Room.find({ topic: 'xxx' })
t.is(result, null, `should return null if cannot find the room`)
} catch (e) {
t.pass('should throw before login or not found')
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册