migrate to use ot.js - fix test

Signed-off-by: Raccoon <raccoon@hackmd.io>
This commit is contained in:
Raccoon 2021-06-12 09:17:12 +08:00
parent b0b079a33a
commit 99e38d4cda
No known key found for this signature in database
GPG Key ID: 06770355DC9ECD38
2 changed files with 5 additions and 4 deletions

View File

@ -236,7 +236,6 @@
"ignore": [
"/public/build",
"/public/vendor",
"/lib/ot",
"webpack.*"
]
},

View File

@ -5,7 +5,7 @@ const path = require('path')
function makeMockSocket (headers, query) {
const broadCastChannelCache = {}
return {
const fakesocket = {
id: Math.round(Math.random() * 10000),
request: {
user: {}
@ -14,8 +14,6 @@ function makeMockSocket (headers, query) {
headers: Object.assign({}, headers),
query: Object.assign({}, query)
},
on: sinon.fake(),
emit: sinon.fake(),
broadCastChannelCache: {},
broadcast: {
to: (channel) => {
@ -31,6 +29,10 @@ function makeMockSocket (headers, query) {
disconnect: sinon.fake(),
rooms: []
}
fakesocket.on = sinon.fake.returns(fakesocket)
fakesocket.emit = sinon.fake.returns(fakesocket)
fakesocket.join = sinon.fake.returns(fakesocket)
return fakesocket
}
function removeModuleFromRequireCache (modulePath) {