提交 6f15061b authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

More test units.

上级 bf309e06
...@@ -35,3 +35,24 @@ tap.test('room.createPeer() without peerId must fail', { timeout: 1000 }, (t) => ...@@ -35,3 +35,24 @@ tap.test('room.createPeer() without peerId must fail', { timeout: 1000 }, (t) =>
}) })
.catch((error) => t.fail(`should not fail: ${error}`)); .catch((error) => t.fail(`should not fail: ${error}`));
}); });
tap.test('room.createPeer() with same `peerId` must fail', { timeout: 1000 }, (t) =>
{
let server = mediasoup.Server();
t.tearDown(() => server.close());
server.createRoom()
.then((room) =>
{
room.createPeer('alice')
.then(() =>
{
room.createPeer('alice')
.then(() => t.fail('should not succeed'))
.catch(() => t.end());
})
.catch((error) => t.fail(`should not fail: ${error}`));
})
.catch((error) => t.fail(`should not fail: ${error}`));
});
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论