mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
fix Metrics module stub
This commit is contained in:
parent
8176cb3e8d
commit
cf87daa754
1 changed files with 12 additions and 5 deletions
|
@ -20,6 +20,7 @@ const Errors = require('../../../../app/js/Errors.js')
|
|||
|
||||
describe('DispatchManager', function () {
|
||||
beforeEach(function () {
|
||||
let Timer
|
||||
this.timeout(3000)
|
||||
this.DispatchManager = SandboxedModule.require(modulePath, {
|
||||
requires: {
|
||||
|
@ -37,11 +38,17 @@ describe('DispatchManager', function () {
|
|||
'redis-sharelatex': (this.redis = {}),
|
||||
'./RateLimitManager': {},
|
||||
'./Errors': Errors,
|
||||
'./Metrics': {
|
||||
Timer() {
|
||||
return { done() {} }
|
||||
}
|
||||
}
|
||||
'./Metrics': (this.Metrics = {
|
||||
Timer: (Timer = (function () {
|
||||
Timer = class Timer {
|
||||
static initClass() {
|
||||
this.prototype.done = sinon.stub()
|
||||
}
|
||||
}
|
||||
Timer.initClass()
|
||||
return Timer
|
||||
})())
|
||||
})
|
||||
}
|
||||
})
|
||||
this.callback = sinon.stub()
|
||||
|
|
Loading…
Reference in a new issue