mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-30 20:31:34 +02:00
Fix unit tests for modules now using metrics.timeAsyncMethod
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user