Browse Source

Merge pull request #1937 from overleaf/spd-sandboxedmodule-global-console

Add 'console' to SandboxedModule globals

GitOrigin-RevId: fad442ca128561a4fa193b929f217cf31ad0f043
Shane Kilkelly 7 years ago
parent
commit
238e2b2565
100 changed files with 309 additions and 0 deletions
  1. 3 0
      services/web/test/unit/src/Analytics/AnalyticsControllerTests.js
  2. 3 0
      services/web/test/unit/src/Analytics/AnalyticsManagerTests.js
  3. 3 0
      services/web/test/unit/src/Announcement/AnnouncementsHandlerTests.js
  4. 3 0
      services/web/test/unit/src/Authentication/AuthenticationControllerTests.js
  5. 3 0
      services/web/test/unit/src/Authentication/AuthenticationManagerTests.js
  6. 3 0
      services/web/test/unit/src/Authorization/AuthorizationManagerTests.js
  7. 3 0
      services/web/test/unit/src/Authorization/AuthorizationMiddlewareTests.js
  8. 3 0
      services/web/test/unit/src/BetaProgram/BetaProgramControllerTests.js
  9. 3 0
      services/web/test/unit/src/BetaProgram/BetaProgramHandlerTests.js
  10. 3 0
      services/web/test/unit/src/Blog/BlogControllerTests.js
  11. 3 0
      services/web/test/unit/src/BrandVariations/BrandVariationsHandlerTests.js
  12. 3 0
      services/web/test/unit/src/Chat/ChatApiHandlerTests.js
  13. 3 0
      services/web/test/unit/src/Chat/ChatControllerTests.js
  14. 3 0
      services/web/test/unit/src/Collaborators/CollaboratorsControllerTests.js
  15. 3 0
      services/web/test/unit/src/Collaborators/CollaboratorsHandlerTests.js
  16. 3 0
      services/web/test/unit/src/Collaborators/CollaboratorsInviteControllerTests.js
  17. 3 0
      services/web/test/unit/src/Collaborators/CollaboratorsInviteHandlerTests.js
  18. 12 0
      services/web/test/unit/src/Compile/ClsiCookieManagerTests.js
  19. 3 0
      services/web/test/unit/src/Compile/ClsiFormatCheckerTests.js
  20. 3 0
      services/web/test/unit/src/Compile/ClsiManagerTests.js
  21. 3 0
      services/web/test/unit/src/Compile/ClsiStateManagerTests.js
  22. 3 0
      services/web/test/unit/src/Compile/CompileControllerTests.js
  23. 3 0
      services/web/test/unit/src/Compile/CompileManagerTests.js
  24. 3 0
      services/web/test/unit/src/Contact/ContactControllerTests.js
  25. 3 0
      services/web/test/unit/src/Contact/ContactManagerTests.js
  26. 3 0
      services/web/test/unit/src/Cooldown/CooldownManagerTests.js
  27. 3 0
      services/web/test/unit/src/Cooldown/CooldownMiddlewareTests.js
  28. 3 0
      services/web/test/unit/src/Docstore/DocstoreManagerTests.js
  29. 3 0
      services/web/test/unit/src/DocumentUpdater/DocumentUpdaterHandlerTests.js
  30. 3 0
      services/web/test/unit/src/Documents/DocumentControllerTests.js
  31. 3 0
      services/web/test/unit/src/Downloads/ProjectDownloadsControllerTests.js
  32. 3 0
      services/web/test/unit/src/Downloads/ProjectZipStreamManagerTests.js
  33. 3 0
      services/web/test/unit/src/Editor/EditorControllerTests.js
  34. 3 0
      services/web/test/unit/src/Editor/EditorHttpControllerTests.js
  35. 3 0
      services/web/test/unit/src/Editor/EditorRealTimeControllerTests.js
  36. 3 0
      services/web/test/unit/src/Email/EmailBuilderTests.js
  37. 3 0
      services/web/test/unit/src/Email/EmailHandlerTests.js
  38. 3 0
      services/web/test/unit/src/Email/EmailSenderTests.js
  39. 3 0
      services/web/test/unit/src/Exports/ExportsControllerTests.js
  40. 3 0
      services/web/test/unit/src/Exports/ExportsHandlerTests.js
  41. 3 0
      services/web/test/unit/src/FileStore/FileStoreControllerTests.js
  42. 3 0
      services/web/test/unit/src/FileStore/FileStoreHandlerTests.js
  43. 3 0
      services/web/test/unit/src/History/HistoryControllerTests.js
  44. 3 0
      services/web/test/unit/src/History/HistoryManagerTests.js
  45. 3 0
      services/web/test/unit/src/History/RestoreManagerTests.js
  46. 3 0
      services/web/test/unit/src/InactiveData/InactiveProjectManagerTests.js
  47. 3 0
      services/web/test/unit/src/Institutions/InstitutionsAPITests.js
  48. 3 0
      services/web/test/unit/src/Institutions/InstitutionsControllerTests.js
  49. 3 0
      services/web/test/unit/src/Institutions/InstitutionsFeaturesTests.js
  50. 3 0
      services/web/test/unit/src/Institutions/InstitutionsGetterTests.js
  51. 3 0
      services/web/test/unit/src/Institutions/InstitutionsManagerTests.js
  52. 3 0
      services/web/test/unit/src/Metadata/MetaControllerTests.js
  53. 3 0
      services/web/test/unit/src/Metadata/MetaHandlerTests.js
  54. 3 0
      services/web/test/unit/src/Notifications/NotificationsBuilderTests.js
  55. 3 0
      services/web/test/unit/src/Notifications/NotificationsControllerTests.js
  56. 3 0
      services/web/test/unit/src/Notifications/NotificationsHandlerTests.js
  57. 3 0
      services/web/test/unit/src/PasswordReset/PasswordResetControllerTests.js
  58. 3 0
      services/web/test/unit/src/PasswordReset/PasswordResetHandlerTests.js
  59. 3 0
      services/web/test/unit/src/Project/DocLinesComparitorTests.js
  60. 3 0
      services/web/test/unit/src/Project/ProjectApiControllerTests.js
  61. 3 0
      services/web/test/unit/src/Project/ProjectCollabratecDetailsTest.js
  62. 3 0
      services/web/test/unit/src/Project/ProjectControllerTests.js
  63. 3 0
      services/web/test/unit/src/Project/ProjectCreationHandlerTests.js
  64. 3 0
      services/web/test/unit/src/Project/ProjectDeleterTests.js
  65. 3 0
      services/web/test/unit/src/Project/ProjectDetailsHandlerTests.js
  66. 3 0
      services/web/test/unit/src/Project/ProjectDuplicatorTests.js
  67. 3 0
      services/web/test/unit/src/Project/ProjectEntityHandlerTests.js
  68. 3 0
      services/web/test/unit/src/Project/ProjectEntityMongoUpdateHandlerTests.js
  69. 3 0
      services/web/test/unit/src/Project/ProjectEntityUpdateHandlerTests.js
  70. 3 0
      services/web/test/unit/src/Project/ProjectGetterTests.js
  71. 3 0
      services/web/test/unit/src/Project/ProjectHistoryHandlerTests.js
  72. 3 0
      services/web/test/unit/src/Project/ProjectLocatorTests.js
  73. 3 0
      services/web/test/unit/src/Project/ProjectOptionsHandlerTests.js
  74. 3 0
      services/web/test/unit/src/Project/ProjectRootDocManagerTests.js
  75. 3 0
      services/web/test/unit/src/Project/ProjectUpdateHandlerTests.js
  76. 3 0
      services/web/test/unit/src/Publishers/PublishersGetterTests.js
  77. 3 0
      services/web/test/unit/src/Referal/ReferalAllocatorTests.js
  78. 3 0
      services/web/test/unit/src/Referal/ReferalConnectTests.js
  79. 3 0
      services/web/test/unit/src/Referal/ReferalControllerTests.js
  80. 3 0
      services/web/test/unit/src/Referal/ReferalFeaturesTests.js
  81. 3 0
      services/web/test/unit/src/Referal/ReferalHandlerTests.js
  82. 3 0
      services/web/test/unit/src/References/ReferencesControllerTests.js
  83. 3 0
      services/web/test/unit/src/References/ReferencesHandlerTests.js
  84. 3 0
      services/web/test/unit/src/Security/LoginRateLimiterTests.js
  85. 3 0
      services/web/test/unit/src/Security/OneTimeTokenHandlerTests.js
  86. 3 0
      services/web/test/unit/src/Security/RateLimiterMiddlewareTests.js
  87. 3 0
      services/web/test/unit/src/Subscription/FeaturesUpdaterTests.js
  88. 3 0
      services/web/test/unit/src/Subscription/LimitationsManagerTests.js
  89. 3 0
      services/web/test/unit/src/Subscription/RecurlyWrapperTests.js
  90. 3 0
      services/web/test/unit/src/Subscription/SubscriptionControllerTests.js
  91. 3 0
      services/web/test/unit/src/Subscription/SubscriptionGroupControllerTests.js
  92. 3 0
      services/web/test/unit/src/Subscription/SubscriptionGroupHandlerTests.js
  93. 3 0
      services/web/test/unit/src/Subscription/SubscriptionHandlerTests.js
  94. 3 0
      services/web/test/unit/src/Subscription/SubscriptionLocatorTests.js
  95. 3 0
      services/web/test/unit/src/Subscription/SubscriptionUpdaterTests.js
  96. 3 0
      services/web/test/unit/src/Subscription/TeamInvitesHandlerTests.js
  97. 3 0
      services/web/test/unit/src/Subscription/UserFeaturesUpdaterTests.js
  98. 3 0
      services/web/test/unit/src/Subscription/V1SusbcriptionManagerTests.js
  99. 3 0
      services/web/test/unit/src/SudoMode/SudoModeControllerTests.js
  100. 3 0
      services/web/test/unit/src/SudoMode/SudoModeHandlerTests.js

+ 3 - 0
services/web/test/unit/src/Analytics/AnalyticsControllerTests.js

@@ -20,6 +20,9 @@ describe('AnalyticsController', function() {
     }
 
     this.controller = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         './AnalyticsManager': this.AnalyticsManager,
         '../Authentication/AuthenticationController': this

+ 3 - 0
services/web/test/unit/src/Analytics/AnalyticsManagerTests.js

@@ -18,6 +18,9 @@ describe('AnalyticsManager', function() {
     this.backgroundRequest = sinon.stub().yields()
     this.request = sinon.stub().yields()
     this.AnalyticsManager = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         'settings-sharelatex': this.settings,
         '../../infrastructure/FaultTolerantRequest': {

+ 3 - 0
services/web/test/unit/src/Announcement/AnnouncementsHandlerTests.js

@@ -32,6 +32,9 @@ describe('AnnouncementsHandler', function() {
     this.BlogHandler = { getLatestAnnouncements: sinon.stub() }
     this.settings = {}
     return (this.handler = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         '../Analytics/AnalyticsManager': this.AnalyticsManager,
         '../Blog/BlogHandler': this.BlogHandler,

+ 3 - 0
services/web/test/unit/src/Authentication/AuthenticationControllerTests.js

@@ -30,6 +30,9 @@ describe('AuthenticationController', function() {
     tk.freeze(Date.now())
     this.UserModel = { findOne: sinon.stub() }
     this.AuthenticationController = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         './AuthenticationManager': (this.AuthenticationManager = {}),
         '../User/UserUpdater': (this.UserUpdater = {

+ 3 - 0
services/web/test/unit/src/Authentication/AuthenticationManagerTests.js

@@ -27,6 +27,9 @@ describe('AuthenticationManager', function() {
   beforeEach(function() {
     this.settings = { security: { bcryptRounds: 12 } }
     this.AuthenticationManager = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         '../../models/User': {
           User: (this.User = {})

+ 3 - 0
services/web/test/unit/src/Authorization/AuthorizationManagerTests.js

@@ -23,6 +23,9 @@ const Errors = require('../../../../app/src/Features/Errors/Errors.js')
 describe('AuthorizationManager', function() {
   beforeEach(function() {
     this.AuthorizationManager = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         '../Collaborators/CollaboratorsHandler': (this.CollaboratorsHandler = {}),
         '../Project/ProjectGetter': (this.ProjectGetter = {}),

+ 3 - 0
services/web/test/unit/src/Authorization/AuthorizationMiddlewareTests.js

@@ -30,6 +30,9 @@ describe('AuthorizationMiddleware', function() {
       isUserLoggedIn: sinon.stub().returns(true)
     }
     this.AuthorizationMiddleware = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         './AuthorizationManager': (this.AuthorizationManager = {}),
         'logger-sharelatex': { log() {} },

+ 3 - 0
services/web/test/unit/src/BetaProgram/BetaProgramControllerTests.js

@@ -37,6 +37,9 @@ describe('BetaProgramController', function() {
       }
     }
     this.BetaProgramController = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         './BetaProgramHandler': (this.BetaProgramHandler = {
           optIn: sinon.stub(),

+ 3 - 0
services/web/test/unit/src/BetaProgram/BetaProgramHandlerTests.js

@@ -33,6 +33,9 @@ describe('BetaProgramHandler', function() {
       save: sinon.stub().callsArgWith(0, null)
     }
     return (this.handler = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         '../../models/User': {
           User: {

+ 3 - 0
services/web/test/unit/src/Blog/BlogControllerTests.js

@@ -33,6 +33,9 @@ describe('BlogController', function() {
     this.request = { get: sinon.stub() }
     this.ErrorController = {}
     this.BlogController = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         'settings-sharelatex': this.settings,
         'logger-sharelatex': {

+ 3 - 0
services/web/test/unit/src/BrandVariations/BrandVariationsHandlerTests.js

@@ -38,6 +38,9 @@ describe('BrandVariationsHandler', function() {
     }
     this.V1Api = { request: sinon.stub() }
     this.BrandVariationsHandler = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         'settings-sharelatex': this.settings,
         'logger-sharelatex': this.logger,

+ 3 - 0
services/web/test/unit/src/Chat/ChatApiHandlerTests.js

@@ -32,6 +32,9 @@ describe('ChatApiHandler', function() {
     }
     this.request = sinon.stub()
     this.ChatApiHandler = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         'settings-sharelatex': this.settings,
         'logger-sharelatex': {

+ 3 - 0
services/web/test/unit/src/Chat/ChatControllerTests.js

@@ -33,6 +33,9 @@ describe('ChatController', function() {
       getLoggedInUserId: sinon.stub().returns(this.user_id)
     }
     this.ChatController = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         'settings-sharelatex': this.settings,
         'logger-sharelatex': {

+ 3 - 0
services/web/test/unit/src/Collaborators/CollaboratorsControllerTests.js

@@ -25,6 +25,9 @@ const { ObjectId } = require('mongojs')
 describe('CollaboratorsController', function() {
   beforeEach(function() {
     this.CollaboratorsController = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         './CollaboratorsHandler': (this.CollaboratorsHandler = {}),
         '../Editor/EditorRealTimeController': (this.EditorRealTimeController = {}),

+ 3 - 0
services/web/test/unit/src/Collaborators/CollaboratorsHandlerTests.js

@@ -29,6 +29,9 @@ const { ObjectId } = require('mongojs')
 describe('CollaboratorsHandler', function() {
   beforeEach(function() {
     this.CollaboratorHandler = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         'logger-sharelatex': (this.logger = {
           log: sinon.stub(),

+ 3 - 0
services/web/test/unit/src/Collaborators/CollaboratorsInviteControllerTests.js

@@ -44,6 +44,9 @@ describe('CollaboratorsInviteController', function() {
     }
 
     this.CollaboratorsInviteController = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         '../Project/ProjectGetter': (this.ProjectGetter = {}),
         '../Subscription/LimitationsManager': this.LimitationsManager,

+ 3 - 0
services/web/test/unit/src/Collaborators/CollaboratorsInviteHandlerTests.js

@@ -54,6 +54,9 @@ describe('CollaboratorsInviteHandler', function() {
     })()
     this.Crypto = Crypto
     this.CollaboratorsInviteHandler = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         'settings-sharelatex': (this.settings = {}),
         '../../models/ProjectInvite': { ProjectInvite: this.ProjectInvite },

+ 12 - 0
services/web/test/unit/src/Compile/ClsiCookieManagerTests.js

@@ -70,6 +70,9 @@ describe('ClsiCookieManager', function() {
       })
     }
     return (this.ClsiCookieManager = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: this.requires
     })())
   })
@@ -196,6 +199,9 @@ describe('ClsiCookieManager', function() {
     it('should not set the server id if clsiCookies are not enabled', function(done) {
       delete this.settings.clsiCookie.key
       this.ClsiCookieManager = SandboxedModule.require(modulePath, {
+        globals: {
+          console: console
+        },
         requires: this.requires
       })()
       return this.ClsiCookieManager.setServerId(
@@ -236,6 +242,9 @@ describe('ClsiCookieManager', function() {
         .withArgs('clsi_cookie_secondary')
         .returns(this.redis_secondary)
       this.ClsiCookieManager = SandboxedModule.require(modulePath, {
+        globals: {
+          console: console
+        },
         requires: this.requires
       })()
       this.ClsiCookieManager._parseServerIdFromResponse = sinon
@@ -285,6 +294,9 @@ describe('ClsiCookieManager', function() {
     it('should return empty cookie jar if clsiCookies are not enabled', function(done) {
       delete this.settings.clsiCookie.key
       this.ClsiCookieManager = SandboxedModule.require(modulePath, {
+        globals: {
+          console: console
+        },
         requires: this.requires
       })()
       return this.ClsiCookieManager.getCookieJar(this.project_id, function(

+ 3 - 0
services/web/test/unit/src/Compile/ClsiFormatCheckerTests.js

@@ -21,6 +21,9 @@ const SandboxedModule = require('sandboxed-module')
 describe('ClsiFormatChecker', function() {
   beforeEach(function() {
     this.ClsiFormatChecker = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         'settings-sharelatex': (this.settings = { compileBodySizeLimitMb: 5 }),
         'logger-sharelatex': (this.logger = {

+ 3 - 0
services/web/test/unit/src/Compile/ClsiManagerTests.js

@@ -35,6 +35,9 @@ describe('ClsiManager', function() {
       checkRecoursesForProblems: sinon.stub().callsArgWith(1)
     }
     this.ClsiManager = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         'settings-sharelatex': (this.settings = {
           apis: {

+ 3 - 0
services/web/test/unit/src/Compile/ClsiStateManagerTests.js

@@ -22,6 +22,9 @@ const SandboxedModule = require('sandboxed-module')
 describe('ClsiStateManager', function() {
   beforeEach(function() {
     this.ClsiStateManager = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         'settings-sharelatex': (this.settings = {}),
         '../Project/ProjectEntityHandler': (this.ProjectEntityHandler = {}),

+ 3 - 0
services/web/test/unit/src/Compile/CompileControllerTests.js

@@ -61,6 +61,9 @@ describe('CompileController', function() {
       isUserLoggedIn: sinon.stub().returns(true)
     }
     this.CompileController = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         'settings-sharelatex': this.settings,
         request: (this.request = sinon.stub()),

+ 3 - 0
services/web/test/unit/src/Compile/CompileManagerTests.js

@@ -27,6 +27,9 @@ describe('CompileManager', function() {
     const { rateLimitGetStub } = this
     this.ratelimiter = { addCount: sinon.stub() }
     this.CompileManager = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         'settings-sharelatex': (this.settings = {
           redis: { web: { host: 'localhost', port: 42 } }

+ 3 - 0
services/web/test/unit/src/Contact/ContactControllerTests.js

@@ -23,6 +23,9 @@ describe('ContactController', function() {
   beforeEach(function() {
     this.AuthenticationController = { getLoggedInUserId: sinon.stub() }
     this.ContactController = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         'logger-sharelatex': (this.logger = {
           log: sinon.stub(),

+ 3 - 0
services/web/test/unit/src/Contact/ContactManagerTests.js

@@ -18,6 +18,9 @@ const SandboxedModule = require('sandboxed-module')
 describe('ContactManager', function() {
   beforeEach(function() {
     this.ContactManager = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         request: (this.request = sinon.stub()),
         'settings-sharelatex': (this.settings = {

+ 3 - 0
services/web/test/unit/src/Cooldown/CooldownManagerTests.js

@@ -25,6 +25,9 @@ describe('CooldownManager', function() {
     this.rclient = { set: sinon.stub(), get: sinon.stub() }
     this.RedisWrapper = { client: () => this.rclient }
     return (this.CooldownManager = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         '../../infrastructure/RedisWrapper': this.RedisWrapper,
         'logger-sharelatex': { log: sinon.stub() }

+ 3 - 0
services/web/test/unit/src/Cooldown/CooldownMiddlewareTests.js

@@ -22,6 +22,9 @@ describe('CooldownMiddleware', function() {
   beforeEach(function() {
     this.CooldownManager = { isProjectOnCooldown: sinon.stub() }
     return (this.CooldownMiddleware = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         './CooldownManager': this.CooldownManager,
         'logger-sharelatex': { log: sinon.stub() }

+ 3 - 0
services/web/test/unit/src/Docstore/DocstoreManagerTests.js

@@ -20,6 +20,9 @@ describe('DocstoreManager', function() {
   beforeEach(function() {
     this.requestDefaults = sinon.stub().returns((this.request = sinon.stub()))
     this.DocstoreManager = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         request: {
           defaults: this.requestDefaults

+ 3 - 0
services/web/test/unit/src/DocumentUpdater/DocumentUpdaterHandlerTests.js

@@ -49,6 +49,9 @@ describe('DocumentUpdaterHandler', function() {
 
     this.callback = sinon.stub()
     return (this.handler = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         request: {
           defaults: () => {

+ 3 - 0
services/web/test/unit/src/Documents/DocumentControllerTests.js

@@ -25,6 +25,9 @@ const Errors = require('../../../../app/src/Features/Errors/Errors')
 describe('DocumentController', function() {
   beforeEach(function() {
     this.DocumentController = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         'logger-sharelatex': {
           log() {},

+ 3 - 0
services/web/test/unit/src/Downloads/ProjectDownloadsControllerTests.js

@@ -30,6 +30,9 @@ describe('ProjectDownloadsController', function() {
     return (this.ProjectDownloadsController = SandboxedModule.require(
       modulePath,
       {
+        globals: {
+          console: console
+        },
         requires: {
           './ProjectZipStreamManager': (this.ProjectZipStreamManager = {}),
           '../Project/ProjectGetter': (this.ProjectGetter = {}),

+ 3 - 0
services/web/test/unit/src/Downloads/ProjectZipStreamManagerTests.js

@@ -33,6 +33,9 @@ describe('ProjectZipStreamManager', function() {
       append: sinon.stub()
     }
     return (this.ProjectZipStreamManager = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         archiver: (this.archiver = sinon.stub().returns(this.archive)),
         'logger-sharelatex': (this.logger = {

+ 3 - 0
services/web/test/unit/src/Editor/EditorControllerTests.js

@@ -45,6 +45,9 @@ describe('EditorController', function() {
     this.callback = sinon.stub()
 
     return (this.EditorController = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         '../Project/ProjectEntityUpdateHandler': (this.ProjectEntityUpdateHandler = {}),
         '../Project/ProjectOptionsHandler': (this.ProjectOptionsHandler = {

+ 3 - 0
services/web/test/unit/src/Editor/EditorHttpControllerTests.js

@@ -21,6 +21,9 @@ const Errors = require('../../../../app/src/Features/Errors/Errors')
 describe('EditorHttpController', function() {
   beforeEach(function() {
     this.EditorHttpController = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         '../Project/ProjectEntityUpdateHandler': (this.ProjectEntityUpdateHandler = {}),
         '../Project/ProjectDeleter': (this.ProjectDeleter = {}),

+ 3 - 0
services/web/test/unit/src/Editor/EditorRealTimeControllerTests.js

@@ -22,6 +22,9 @@ describe('EditorRealTimeController', function() {
   beforeEach(function() {
     this.rclient = { publish: sinon.stub() }
     this.EditorRealTimeController = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         '../../infrastructure/RedisWrapper': {
           client: () => this.rclient

+ 3 - 0
services/web/test/unit/src/Email/EmailBuilderTests.js

@@ -31,6 +31,9 @@ describe('EmailBuilder', function() {
       brandPrefix: ''
     }
     return (this.EmailBuilder = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         'settings-sharelatex': this.settings,
         'logger-sharelatex': {

+ 3 - 0
services/web/test/unit/src/Email/EmailHandlerTests.js

@@ -27,6 +27,9 @@ describe('EmailHandler', function() {
     this.EmailBuilder = { buildEmail: sinon.stub() }
     this.EmailSender = { sendEmail: sinon.stub() }
     this.EmailHandler = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         './EmailBuilder': this.EmailBuilder,
         './EmailSender': this.EmailSender,

+ 3 - 0
services/web/test/unit/src/Email/EmailSenderTests.js

@@ -42,6 +42,9 @@ describe('EmailSender', function() {
     this.ses = { createTransport: () => this.sesClient }
 
     this.sender = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         nodemailer: this.ses,
         'nodemailer-mandrill-transport': {},

+ 3 - 0
services/web/test/unit/src/Exports/ExportsControllerTests.js

@@ -64,6 +64,9 @@ describe('ExportsController', function() {
       getLoggedInUserId: sinon.stub().returns(this.req.session.user._id)
     }
     return (this.controller = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         './ExportsHandler': this.handler,
         'logger-sharelatex': {

+ 3 - 0
services/web/test/unit/src/Exports/ExportsHandlerTests.js

@@ -27,6 +27,9 @@ describe('ExportsHandler', function() {
       }
     }
     this.ExportsHandler = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         'logger-sharelatex': {
           log() {},

+ 3 - 0
services/web/test/unit/src/FileStore/FileStoreControllerTests.js

@@ -14,6 +14,9 @@ describe('FileStoreController', function() {
     this.ProjectLocator = { findElement: sinon.stub() }
     this.Errors = { NotFoundError: sinon.stub() }
     this.controller = SandboxedModule.require(MODULE_PATH, {
+      globals: {
+        console: console
+      },
       requires: {
         'settings-sharelatex': this.settings,
         'logger-sharelatex': (this.logger = {

+ 3 - 0
services/web/test/unit/src/FileStore/FileStoreHandlerTests.js

@@ -63,6 +63,9 @@ describe('FileStoreHandler', function() {
       computeHash: sinon.stub().callsArgWith(1, null, this.hashValue)
     }
     this.handler = SandboxedModule.require(MODULE_PATH, {
+      globals: {
+        console: console
+      },
       requires: {
         'settings-sharelatex': this.settings,
         request: this.request,

+ 3 - 0
services/web/test/unit/src/History/HistoryControllerTests.js

@@ -26,6 +26,9 @@ describe('HistoryController', function() {
       getLoggedInUserId: sinon.stub().returns(this.user_id)
     }
     this.HistoryController = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         request: (this.request = sinon.stub()),
         'settings-sharelatex': (this.settings = {}),

+ 3 - 0
services/web/test/unit/src/History/HistoryManagerTests.js

@@ -24,6 +24,9 @@ describe('HistoryManager', function() {
       getLoggedInUserId: sinon.stub().returns(this.user_id)
     }
     this.HistoryManager = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         request: (this.request = sinon.stub()),
         'settings-sharelatex': (this.settings = {}),

+ 3 - 0
services/web/test/unit/src/History/RestoreManagerTests.js

@@ -27,6 +27,9 @@ describe('RestoreManager', function() {
   beforeEach(function() {
     tk.freeze(Date.now()) // freeze the time for these tests
     this.RestoreManager = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         '../../infrastructure/FileWriter': (this.FileWriter = {}),
         '../Uploads/FileSystemImportManager': (this.FileSystemImportManager = {}),

+ 3 - 0
services/web/test/unit/src/InactiveData/InactiveProjectManagerTests.js

@@ -36,6 +36,9 @@ describe('InactiveProjectManager', function() {
     this.ProjectGetter = { getProject: sinon.stub() }
     this.TrackChangesManager = { archiveProject: sinon.stub() }
     this.InactiveProjectManager = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         'settings-sharelatex': this.settings,
         'logger-sharelatex': {

+ 3 - 0
services/web/test/unit/src/Institutions/InstitutionsAPITests.js

@@ -31,6 +31,9 @@ describe('InstitutionsAPI', function() {
       read: (this.markAsReadIpMatcher = sinon.stub().callsArgWith(1, null))
     }
     this.InstitutionsAPI = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         'logger-sharelatex': this.logger,
         'metrics-sharelatex': {

+ 3 - 0
services/web/test/unit/src/Institutions/InstitutionsControllerTests.js

@@ -51,6 +51,9 @@ describe('InstitutionsController', function() {
     this.addAffiliation = sinon.stub().callsArgWith(3, null)
     this.refreshFeatures = sinon.stub().yields(null)
     this.InstitutionsController = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         'logger-sharelatex': this.logger,
         '../User/UserGetter': {

+ 3 - 0
services/web/test/unit/src/Institutions/InstitutionsFeaturesTests.js

@@ -26,6 +26,9 @@ describe('InstitutionsFeatures', function() {
     this.PlansLocator = { findLocalPlanInSettings: sinon.stub() }
     this.institutionPlanCode = 'institution_plan_code'
     this.InstitutionsFeatures = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         './InstitutionsGetter': this.InstitutionsGetter,
         '../Subscription/PlansLocator': this.PlansLocator,

+ 3 - 0
services/web/test/unit/src/Institutions/InstitutionsGetterTests.js

@@ -22,6 +22,9 @@ describe('InstitutionsGetter', function() {
   beforeEach(function() {
     this.UserGetter = { getUserFullEmails: sinon.stub() }
     this.InstitutionsGetter = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         '../User/UserGetter': this.UserGetter,
         '../UserMembership/UserMembershipsHandler': (this.UserMembershipsHandler = {}),

+ 3 - 0
services/web/test/unit/src/Institutions/InstitutionsManagerTests.js

@@ -64,6 +64,9 @@ describe('InstitutionsManager', function() {
     this.Mongo = { ObjectId: sinon.stub().returnsArg(0) }
 
     return (this.InstitutionsManager = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         'logger-sharelatex': this.logger,
         './InstitutionsAPI': {

+ 3 - 0
services/web/test/unit/src/Metadata/MetaControllerTests.js

@@ -27,6 +27,9 @@ describe('MetaController', function() {
       getMetaForDoc: sinon.stub()
     }
     return (this.MetadataController = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         'logger-sharelatex': {
           log: sinon.stub(),

+ 3 - 0
services/web/test/unit/src/Metadata/MetaHandlerTests.js

@@ -54,6 +54,9 @@ describe('MetaHandler', function() {
     }
 
     return (this.MetaHandler = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         '../Project/ProjectEntityHandler': this.ProjectEntityHandler,
         '../DocumentUpdater/DocumentUpdaterHandler': this

+ 3 - 0
services/web/test/unit/src/Notifications/NotificationsBuilderTests.js

@@ -34,6 +34,9 @@ describe('NotificationsBuilder', function() {
       .returns(this.stubResponse)
       .callsArgWith(1, null, response, this.body)
     return (this.controller = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         './NotificationsHandler': this.handler,
         'settings-sharelatex': this.settings,

+ 3 - 0
services/web/test/unit/src/Notifications/NotificationsControllerTests.js

@@ -46,6 +46,9 @@ describe('NotificationsController', function() {
       getLoggedInUserId: sinon.stub().returns(this.req.session.user._id)
     }
     return (this.controller = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         './NotificationsHandler': this.handler,
         underscore: (this.underscore = {

+ 3 - 0
services/web/test/unit/src/Notifications/NotificationsHandlerTests.js

@@ -30,6 +30,9 @@ describe('NotificationsHandler', function() {
   beforeEach(function() {
     this.request = sinon.stub().callsArgWith(1)
     return (this.handler = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         'settings-sharelatex': {
           apis: { notifications: { url: notificationUrl } }

+ 3 - 0
services/web/test/unit/src/PasswordReset/PasswordResetControllerTests.js

@@ -39,6 +39,9 @@ describe('PasswordResetController', function() {
       removeReconfirmFlag: sinon.stub().callsArgWith(1, null)
     }
     this.PasswordResetController = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         'settings-sharelatex': this.settings,
         './PasswordResetHandler': this.PasswordResetHandler,

+ 3 - 0
services/web/test/unit/src/PasswordReset/PasswordResetHandlerTests.js

@@ -27,6 +27,9 @@ describe('PasswordResetHandler', function() {
     }
     this.V1Api = { request: sinon.stub() }
     this.PasswordResetHandler = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         '../User/UserGetter': this.UserGetter,
         '../Security/OneTimeTokenHandler': this.OneTimeTokenHandler,

+ 3 - 0
services/web/test/unit/src/Project/DocLinesComparitorTests.js

@@ -20,6 +20,9 @@ const SandboxedModule = require('sandboxed-module')
 describe('doc lines comparitor', function() {
   beforeEach(function() {
     return (this.comparitor = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         'logger-sharelatex': { log() {} }
       }

+ 3 - 0
services/web/test/unit/src/Project/ProjectApiControllerTests.js

@@ -20,6 +20,9 @@ describe('Project api controller', function() {
   beforeEach(function() {
     this.ProjectDetailsHandler = { getDetails: sinon.stub() }
     this.controller = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         './ProjectDetailsHandler': this.ProjectDetailsHandler,
         'logger-sharelatex': {

+ 3 - 0
services/web/test/unit/src/Project/ProjectCollabratecDetailsTest.js

@@ -34,6 +34,9 @@ describe('ProjectCollabratecDetailsHandler', function() {
     this.ProjectCollabratecDetailsHandler = SandboxedModule.require(
       modulePath,
       {
+        globals: {
+          console: console
+        },
         requires: {
           '../../models/Project': { Project: this.ProjectModel }
         }

+ 3 - 0
services/web/test/unit/src/Project/ProjectControllerTests.js

@@ -116,6 +116,9 @@ describe('ProjectController', function() {
     this.getUserAffiliations = sinon.stub().callsArgWith(1, null, [])
 
     this.ProjectController = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         'settings-sharelatex': this.settings,
         'logger-sharelatex': {

+ 3 - 0
services/web/test/unit/src/Project/ProjectCreationHandlerTests.js

@@ -89,6 +89,9 @@ describe('ProjectCreationHandler', function() {
     this.AnalyticsManager = { recordEvent: sinon.stub() }
 
     return (this.handler = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         '../../models/User': {
           User: this.User

+ 3 - 0
services/web/test/unit/src/Project/ProjectDeleterTests.js

@@ -72,6 +72,9 @@ describe('ProjectDeleter', function() {
         .yields(null, ['member-id-1', 'member-id-2'])
     }
     return (this.deleter = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         '../Editor/EditorController': this.editorController,
         '../../models/Project': { Project: this.Project },

+ 3 - 0
services/web/test/unit/src/Project/ProjectDetailsHandlerTests.js

@@ -52,6 +52,9 @@ describe('ProjectDetailsHandler', function() {
       removeUserFromProject: sinon.stub().callsArg(2)
     }
     return (this.handler = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         './ProjectGetter': this.ProjectGetter,
         '../../models/Project': {

+ 3 - 0
services/web/test/unit/src/Project/ProjectDuplicatorTests.js

@@ -148,6 +148,9 @@ describe('ProjectDuplicator', function() {
     this.ProjectDeleter = { deleteProject: sinon.stub().callsArgWith(1, null) }
 
     return (this.duplicator = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         '../../models/Project': { Project: this.Project },
         '../DocumentUpdater/DocumentUpdaterHandler': this

+ 3 - 0
services/web/test/unit/src/Project/ProjectEntityHandlerTests.js

@@ -61,6 +61,9 @@ describe('ProjectEntityHandler', function() {
     this.callback = sinon.stub()
 
     return (this.ProjectEntityHandler = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         'logger-sharelatex': (this.logger = {
           log: sinon.stub(),

+ 3 - 0
services/web/test/unit/src/Project/ProjectEntityMongoUpdateHandlerTests.js

@@ -48,6 +48,9 @@ describe('ProjectEntityMongoUpdateHandler', function() {
 
     tk.freeze(Date.now())
     return (this.subject = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         'logger-sharelatex': (this.logger = {
           log: sinon.stub(),

+ 3 - 0
services/web/test/unit/src/Project/ProjectEntityUpdateHandlerTests.js

@@ -85,6 +85,9 @@ describe('ProjectEntityUpdateHandler', function() {
     return (this.ProjectEntityUpdateHandler = SandboxedModule.require(
       modulePath,
       {
+        globals: {
+          console: console
+        },
         requires: {
           'logger-sharelatex': (this.logger = {
             log: sinon.stub(),

+ 3 - 0
services/web/test/unit/src/Project/ProjectGetterTests.js

@@ -24,6 +24,9 @@ describe('ProjectGetter', function() {
   beforeEach(function() {
     this.callback = sinon.stub()
     return (this.ProjectGetter = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         '../../infrastructure/mongojs': {
           db: (this.db = {

+ 3 - 0
services/web/test/unit/src/Project/ProjectHistoryHandlerTests.js

@@ -46,6 +46,9 @@ describe('ProjectHistoryHandler', function() {
     this.callback = sinon.stub()
 
     return (this.ProjectHistoryHandler = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         'logger-sharelatex': (this.logger = {
           log: sinon.stub(),

+ 3 - 0
services/web/test/unit/src/Project/ProjectLocatorTests.js

@@ -66,6 +66,9 @@ describe('ProjectLocator', function() {
       getProject: sinon.stub().callsArgWith(2, null, project)
     }
     return (this.locator = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         '../../models/Project': { Project },
         '../../models/User': { User: this.User },

+ 3 - 0
services/web/test/unit/src/Project/ProjectOptionsHandlerTests.js

@@ -32,6 +32,9 @@ describe('ProjectOptionsHandler', function() {
     this.projectModel.update = sinon.spy()
 
     return (this.handler = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         '../../models/Project': { Project: this.projectModel },
         'settings-sharelatex': {

+ 3 - 0
services/web/test/unit/src/Project/ProjectRootDocManagerTests.js

@@ -41,6 +41,9 @@ describe('ProjectRootDocManager', function() {
       stat: sinon.stub().callsArgWith(1, null, { size: 100 })
     }
     return (this.ProjectRootDocManager = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         './ProjectEntityHandler': (this.ProjectEntityHandler = {}),
         './ProjectEntityUpdateHandler': (this.ProjectEntityUpdateHandler = {}),

+ 3 - 0
services/web/test/unit/src/Project/ProjectUpdateHandlerTests.js

@@ -29,6 +29,9 @@ describe('ProjectUpdateHandler', function() {
     this.ProjectModel = Project = class Project {}
     this.ProjectModel.update = sinon.stub().callsArg(3)
     return (this.handler = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         '../../models/Project': { Project: this.ProjectModel },
         'logger-sharelatex': { log: sinon.stub() }

+ 3 - 0
services/web/test/unit/src/Publishers/PublishersGetterTests.js

@@ -29,6 +29,9 @@ describe('PublishersGetter', function() {
     }
 
     this.PublishersGetter = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         '../User/UserGetter': this.UserGetter,
         '../UserMembership/UserMembershipsHandler': (this.UserMembershipsHandler = {

+ 3 - 0
services/web/test/unit/src/Referal/ReferalAllocatorTests.js

@@ -22,6 +22,9 @@ const modulePath = require('path').join(
 describe('ReferalAllocator', function() {
   beforeEach(function() {
     this.ReferalAllocator = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         '../../models/User': {
           User: (this.User = {})

+ 3 - 0
services/web/test/unit/src/Referal/ReferalConnectTests.js

@@ -22,6 +22,9 @@ const modulePath = require('path').join(
 describe('Referal connect middle wear', function() {
   beforeEach(function() {
     return (this.connect = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         'logger-sharelatex': {
           log() {},

+ 3 - 0
services/web/test/unit/src/Referal/ReferalControllerTests.js

@@ -22,6 +22,9 @@ const modulePath = require('path').join(
 describe('Referal controller', () =>
   beforeEach(function() {
     return (this.controller = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         'logger-sharelatex': {
           log() {},

+ 3 - 0
services/web/test/unit/src/Referal/ReferalFeaturesTests.js

@@ -22,6 +22,9 @@ const modulePath = require('path').join(
 describe('ReferalFeatures', function() {
   beforeEach(function() {
     this.ReferalFeatures = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         '../../models/User': {
           User: (this.User = {})

+ 3 - 0
services/web/test/unit/src/Referal/ReferalHandlerTests.js

@@ -24,6 +24,9 @@ describe('Referal handler', function() {
   beforeEach(function() {
     this.User = { findById: sinon.stub() }
     this.handler = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         'logger-sharelatex': {
           log() {},

+ 3 - 0
services/web/test/unit/src/References/ReferencesControllerTests.js

@@ -23,6 +23,9 @@ describe('ReferencesController', function() {
   beforeEach(function() {
     this.projectId = '2222'
     this.controller = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         'logger-sharelatex': {
           log() {},

+ 3 - 0
services/web/test/unit/src/References/ReferencesHandlerTests.js

@@ -48,6 +48,9 @@ describe('ReferencesHandler', function() {
     }
     this.docIds = ['aaa', 'ccc']
     this.handler = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         'logger-sharelatex': {
           log() {},

+ 3 - 0
services/web/test/unit/src/Security/LoginRateLimiterTests.js

@@ -28,6 +28,9 @@ describe('LoginRateLimiter', function() {
     }
 
     return (this.LoginRateLimiter = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         '../../infrastructure/RateLimiter': this.RateLimiter
       }

+ 3 - 0
services/web/test/unit/src/Security/OneTimeTokenHandlerTests.js

@@ -29,6 +29,9 @@ describe('OneTimeTokenHandler', function() {
     this.stubbedToken = 'mock-token'
     this.callback = sinon.stub()
     return (this.OneTimeTokenHandler = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         'settings-sharelatex': this.settings,
         'logger-sharelatex': {

+ 3 - 0
services/web/test/unit/src/Security/RateLimiterMiddlewareTests.js

@@ -33,6 +33,9 @@ describe('RateLimiterMiddleware', function() {
       }
     }
     this.RateLimiterMiddleware = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         '../../infrastructure/RateLimiter': (this.RateLimiter = {}),
         'logger-sharelatex': (this.logger = { warn: sinon.stub() }),

+ 3 - 0
services/web/test/unit/src/Subscription/FeaturesUpdaterTests.js

@@ -23,6 +23,9 @@ describe('FeaturesUpdater', function() {
     this.user_id = ObjectId().toString()
 
     return (this.FeaturesUpdater = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         './UserFeaturesUpdater': (this.UserFeaturesUpdater = {}),
         './SubscriptionLocator': (this.SubscriptionLocator = {}),

+ 3 - 0
services/web/test/unit/src/Subscription/LimitationsManagerTests.js

@@ -50,6 +50,9 @@ describe('LimitationsManager', function() {
     }
 
     return (this.LimitationsManager = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         '../Project/ProjectGetter': this.ProjectGetter,
         '../User/UserGetter': this.UserGetter,

+ 3 - 0
services/web/test/unit/src/Subscription/RecurlyWrapperTests.js

@@ -144,6 +144,9 @@ describe('RecurlyWrapper', function() {
     return (this.RecurlyWrapper = RecurlyWrapper = SandboxedModule.require(
       modulePath,
       {
+        globals: {
+          console: console
+        },
         requires: {
           'settings-sharelatex': this.settings,
           'logger-sharelatex': {

+ 3 - 0
services/web/test/unit/src/Subscription/SubscriptionControllerTests.js

@@ -91,6 +91,9 @@ describe('SubscriptionController', function() {
     this.GeoIpLookup = { getCurrencyCode: sinon.stub() }
     this.UserGetter = { getUser: sinon.stub().callsArgWith(2, null, this.user) }
     this.SubscriptionController = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         '../Authentication/AuthenticationController': this
           .AuthenticationController,

+ 3 - 0
services/web/test/unit/src/Subscription/SubscriptionGroupControllerTests.js

@@ -59,6 +59,9 @@ describe('SubscriptionGroupController', function() {
     }
 
     return (this.Controller = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         './SubscriptionGroupHandler': this.GroupHandler,
         'logger-sharelatex': {

+ 3 - 0
services/web/test/unit/src/Subscription/SubscriptionGroupHandlerTests.js

@@ -86,6 +86,9 @@ describe('SubscriptionGroupHandler', function() {
     }
 
     return (this.Handler = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         'logger-sharelatex': {
           log() {}

+ 3 - 0
services/web/test/unit/src/Subscription/SubscriptionHandlerTests.js

@@ -87,6 +87,9 @@ describe('SubscriptionHandler', function() {
     this.AnalyticsManager = { recordEvent: sinon.stub() }
 
     this.SubscriptionHandler = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         './RecurlyWrapper': this.RecurlyWrapper,
         'settings-sharelatex': this.Settings,

+ 3 - 0
services/web/test/unit/src/Subscription/SubscriptionLocatorTests.js

@@ -28,6 +28,9 @@ describe('Subscription Locator Tests', function() {
       find: sinon.stub()
     }
     return (this.SubscriptionLocator = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         '../../models/Subscription': {
           Subscription: this.Subscription

+ 3 - 0
services/web/test/unit/src/Subscription/SubscriptionUpdaterTests.js

@@ -95,6 +95,9 @@ describe('SubscriptionUpdater', function() {
       refreshFeatures: sinon.stub().yields()
     }
     this.SubscriptionUpdater = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         '../../models/Subscription': {
           Subscription: this.SubscriptionModel

+ 3 - 0
services/web/test/unit/src/Subscription/TeamInvitesHandlerTests.js

@@ -83,6 +83,9 @@ describe('TeamInvitesHandler', function() {
     this.Subscription.findOne.yields(null, this.subscription)
 
     this.TeamInvitesHandler = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         'logger-sharelatex': { log() {} },
         crypto: this.crypto,

+ 3 - 0
services/web/test/unit/src/Subscription/UserFeaturesUpdaterTests.js

@@ -23,6 +23,9 @@ describe('UserFeaturesUpdater', function() {
   beforeEach(function() {
     this.User = { update: sinon.stub().callsArgWith(2) }
     return (this.UserFeaturesUpdater = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         '../../models/User': {
           User: this.User

+ 3 - 0
services/web/test/unit/src/Subscription/V1SusbcriptionManagerTests.js

@@ -26,6 +26,9 @@ const { expect } = require('chai')
 describe('V1SubscriptionManager', function() {
   beforeEach(function() {
     this.V1SubscriptionManager = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         '../User/UserGetter': (this.UserGetter = {}),
         'logger-sharelatex': {

+ 3 - 0
services/web/test/unit/src/SudoMode/SudoModeControllerTests.js

@@ -36,6 +36,9 @@ describe('SudoModeController', function() {
     }
     this.UserGetter = { getUser: sinon.stub() }
     return (this.SudoModeController = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         'logger-sharelatex': {
           log: sinon.stub(),

+ 3 - 0
services/web/test/unit/src/SudoMode/SudoModeHandlerTests.js

@@ -32,6 +32,9 @@ describe('SudoModeHandler', function() {
     this.rclient = { get: sinon.stub(), set: sinon.stub(), del: sinon.stub() }
     this.RedisWrapper = { client: () => this.rclient }
     return (this.SudoModeHandler = SandboxedModule.require(modulePath, {
+      globals: {
+        console: console
+      },
       requires: {
         '../../infrastructure/RedisWrapper': this.RedisWrapper,
         'logger-sharelatex': (this.logger = {

Some files were not shown because too many files changed in this diff