From 5e112043ca3d341c179d55f67396531dbdbd6a39 Mon Sep 17 00:00:00 2001 From: Shane Kilkelly Date: Thu, 16 Mar 2017 11:08:17 +0000 Subject: [PATCH] Fix unit tests for modules now using metrics.timeAsyncMethod --- .../web/test/UnitTests/coffee/Project/ProjectGetterTests.coffee | 1 + services/web/test/UnitTests/coffee/User/UserLocatorTests.coffee | 1 + services/web/test/UnitTests/coffee/User/UserUpdaterTests.coffee | 1 + 3 files changed, 3 insertions(+) diff --git a/services/web/test/UnitTests/coffee/Project/ProjectGetterTests.coffee b/services/web/test/UnitTests/coffee/Project/ProjectGetterTests.coffee index 5ab82d611c..e70ca97075 100644 --- a/services/web/test/UnitTests/coffee/Project/ProjectGetterTests.coffee +++ b/services/web/test/UnitTests/coffee/Project/ProjectGetterTests.coffee @@ -16,6 +16,7 @@ describe "ProjectGetter", -> projects: {} users: {} ObjectId: ObjectId + "../../infrastructure/Metrics": timeAsyncMethod: sinon.stub() "../../models/Project": Project: @Project = {} "../Collaborators/CollaboratorsHandler": @CollaboratorsHandler = {} "logger-sharelatex": diff --git a/services/web/test/UnitTests/coffee/User/UserLocatorTests.coffee b/services/web/test/UnitTests/coffee/User/UserLocatorTests.coffee index 33ac702e6f..bb1f4250c4 100644 --- a/services/web/test/UnitTests/coffee/User/UserLocatorTests.coffee +++ b/services/web/test/UnitTests/coffee/User/UserLocatorTests.coffee @@ -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) diff --git a/services/web/test/UnitTests/coffee/User/UserUpdaterTests.coffee b/services/web/test/UnitTests/coffee/User/UserUpdaterTests.coffee index 7dc67dc661..b5de3df1cc 100644 --- a/services/web/test/UnitTests/coffee/User/UserUpdaterTests.coffee +++ b/services/web/test/UnitTests/coffee/User/UserUpdaterTests.coffee @@ -21,6 +21,7 @@ describe "UserUpdater", -> "logger-sharelatex": log:-> "./UserLocator":@UserLocator "../../infrastructure/mongojs":@mongojs + "../../infrastructure/Metrics": timeAsyncMethod: sinon.stub() @stubbedUser = name:"bob"