Skip to content

Commit 0a5123a

Browse files
committed
migrate to use ot.js - fix test
1 parent 5fa41e0 commit 0a5123a

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,6 @@
236236
"ignore": [
237237
"/public/build",
238238
"/public/vendor",
239-
"/lib/ot",
240239
"webpack.*"
241240
]
242241
},

test/realtime/utils.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const path = require('path')
55

66
function makeMockSocket (headers, query) {
77
const broadCastChannelCache = {}
8-
return {
8+
const fakesocket = {
99
id: Math.round(Math.random() * 10000),
1010
request: {
1111
user: {}
@@ -14,8 +14,6 @@ function makeMockSocket (headers, query) {
1414
headers: Object.assign({}, headers),
1515
query: Object.assign({}, query)
1616
},
17-
on: sinon.fake(),
18-
emit: sinon.fake(),
1917
broadCastChannelCache: {},
2018
broadcast: {
2119
to: (channel) => {
@@ -31,6 +29,10 @@ function makeMockSocket (headers, query) {
3129
disconnect: sinon.fake(),
3230
rooms: []
3331
}
32+
fakesocket.on = sinon.fake.returns(fakesocket)
33+
fakesocket.emit = sinon.fake.returns(fakesocket)
34+
fakesocket.join = sinon.fake.returns(fakesocket)
35+
return fakesocket
3436
}
3537

3638
function removeModuleFromRequireCache (modulePath) {

0 commit comments

Comments
 (0)