Fix unit tests for modules now using metrics.timeAsyncMethod

This commit is contained in:
Shane Kilkelly 2017-03-16 11:08:17 +00:00
parent f2b5901776
commit 5e112043ca
3 changed files with 3 additions and 0 deletions

View file

@ -16,6 +16,7 @@ describe "ProjectGetter", ->
projects: {}
users: {}
ObjectId: ObjectId
"../../infrastructure/Metrics": timeAsyncMethod: sinon.stub()
"../../models/Project": Project: @Project = {}
"../Collaborators/CollaboratorsHandler": @CollaboratorsHandler = {}
"logger-sharelatex":

View file

@ -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)

View file

@ -21,6 +21,7 @@ describe "UserUpdater", ->
"logger-sharelatex": log:->
"./UserLocator":@UserLocator
"../../infrastructure/mongojs":@mongojs
"../../infrastructure/Metrics": timeAsyncMethod: sinon.stub()
@stubbedUser =
name:"bob"