mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Fix unit tests for modules now using metrics.timeAsyncMethod
This commit is contained in:
parent
f2b5901776
commit
5e112043ca
3 changed files with 3 additions and 0 deletions
|
@ -16,6 +16,7 @@ describe "ProjectGetter", ->
|
|||
projects: {}
|
||||
users: {}
|
||||
ObjectId: ObjectId
|
||||
"../../infrastructure/Metrics": timeAsyncMethod: sinon.stub()
|
||||
"../../models/Project": Project: @Project = {}
|
||||
"../Collaborators/CollaboratorsHandler": @CollaboratorsHandler = {}
|
||||
"logger-sharelatex":
|
||||
|
|
|
@ -10,6 +10,7 @@ describe "UserLocator", ->
|
|||
@user = {_id:"12390i"}
|
||||
@UserLocator = SandboxedModule.require modulePath, requires:
|
||||
"../../infrastructure/mongojs": db: @db = { users: {} }
|
||||
"../../infrastructure/Metrics": timeAsyncMethod: sinon.stub()
|
||||
@db.users =
|
||||
findOne : sinon.stub().callsArgWith(1, null, @user)
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ describe "UserUpdater", ->
|
|||
"logger-sharelatex": log:->
|
||||
"./UserLocator":@UserLocator
|
||||
"../../infrastructure/mongojs":@mongojs
|
||||
"../../infrastructure/Metrics": timeAsyncMethod: sinon.stub()
|
||||
|
||||
@stubbedUser =
|
||||
name:"bob"
|
||||
|
|
Loading…
Reference in a new issue