mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
fix unit tests
packManager now uses LockManager, which tries to talk to redis and needs to be replaced by a stub in the unit tests.
This commit is contained in:
parent
c2e5c2c751
commit
76d1350593
2 changed files with 4 additions and 0 deletions
|
@ -12,6 +12,7 @@ describe "HttpController", ->
|
|||
"./UpdatesManager": @UpdatesManager = {}
|
||||
"./DiffManager": @DiffManager = {}
|
||||
"./RestoreManager": @RestoreManager = {}
|
||||
"./PackManager": @PackManager = {}
|
||||
@doc_id = "doc-id-123"
|
||||
@project_id = "project-id-123"
|
||||
@next = sinon.stub()
|
||||
|
|
|
@ -3,6 +3,7 @@ chai = require('chai')
|
|||
should = chai.should()
|
||||
expect = chai.expect
|
||||
modulePath = "../../../../app/js/MongoManager.js"
|
||||
packModulePath = "../../../../app/js/PackManager.js"
|
||||
SandboxedModule = require('sandboxed-module')
|
||||
{ObjectId} = require("mongojs")
|
||||
tk = require "timekeeper"
|
||||
|
@ -12,6 +13,8 @@ describe "MongoManager", ->
|
|||
tk.freeze(new Date())
|
||||
@MongoManager = SandboxedModule.require modulePath, requires:
|
||||
"./mongojs" : { db: @db = {}, ObjectId: ObjectId }
|
||||
"./PackManager" : SandboxedModule.require packModulePath, requires:
|
||||
"./LockManager" : {}
|
||||
@callback = sinon.stub()
|
||||
@doc_id = ObjectId().toString()
|
||||
@project_id = ObjectId().toString()
|
||||
|
|
Loading…
Reference in a new issue