mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
18 lines
400 B
CoffeeScript
18 lines
400 B
CoffeeScript
sinon = require('sinon')
|
|
|
|
idCounter = 0
|
|
|
|
module.exports = class MockClient
|
|
constructor: () ->
|
|
@attributes = {}
|
|
@join = sinon.stub()
|
|
@emit = sinon.stub()
|
|
@disconnect = sinon.stub()
|
|
@id = idCounter++
|
|
@publicId = idCounter++
|
|
set : (key, value, callback) ->
|
|
@attributes[key] = value
|
|
callback() if callback?
|
|
get : (key, callback) ->
|
|
callback null, @attributes[key]
|
|
disconnect: () ->
|