mirror of
https://github.com/overleaf/overleaf.git
synced 2024-09-23 02:55:13 -04:00
36 lines
889 B
JavaScript
36 lines
889 B
JavaScript
|
/* eslint-disable
|
||
|
no-unused-vars,
|
||
|
*/
|
||
|
// TODO: This file was created by bulk-decaffeinate.
|
||
|
// Fix any style issues and re-enable lint.
|
||
|
/*
|
||
|
* decaffeinate suggestions:
|
||
|
* DS102: Remove unnecessary code created because of implicit returns
|
||
|
* DS207: Consider shorter variations of null checks
|
||
|
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
||
|
*/
|
||
|
let MockClient
|
||
|
const sinon = require('sinon')
|
||
|
|
||
|
let idCounter = 0
|
||
|
|
||
|
module.exports = MockClient = class MockClient {
|
||
|
constructor() {
|
||
|
this.attributes = {}
|
||
|
this.join = sinon.stub()
|
||
|
this.emit = sinon.stub()
|
||
|
this.disconnect = sinon.stub()
|
||
|
this.id = idCounter++
|
||
|
}
|
||
|
set(key, value, callback) {
|
||
|
this.attributes[key] = value
|
||
|
if (callback != null) {
|
||
|
return callback()
|
||
|
}
|
||
|
}
|
||
|
get(key, callback) {
|
||
|
return callback(null, this.attributes[key])
|
||
|
}
|
||
|
disconnect() {}
|
||
|
}
|