mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Add missing require stubs and remove console.logs in unit tests
This commit is contained in:
parent
3105c6743e
commit
59085c1ddd
5 changed files with 2 additions and 3 deletions
|
@ -1,6 +1,5 @@
|
|||
Project = require('../../models/Project').Project
|
||||
logger = require('logger-sharelatex')
|
||||
Project = require("../../models/Project").Project
|
||||
|
||||
module.exports =
|
||||
markAsUpdated : (project_id, callback)->
|
||||
|
|
|
@ -70,7 +70,6 @@ describe 'ProjectLocator', ->
|
|||
|
||||
it 'should give error if element could not be found', (done)->
|
||||
@locator.findElement {project_id:project._id, element_id:"ddsd432nj42", type:"docs"}, (err, foundElement, path, parentFolder)->
|
||||
console.log err
|
||||
err.should.deep.equal new Errors.NotFoundError("entity not found")
|
||||
done()
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ describe 'ProjectUpdateHandler', ->
|
|||
@ProjectModel.update = sinon.stub().callsArg(3)
|
||||
@handler = SandboxedModule.require modulePath, requires:
|
||||
'../../models/Project':{Project:@ProjectModel}
|
||||
'logger-sharelatex' : { log: sinon.stub() }
|
||||
|
||||
describe 'marking a project as recently updated', ->
|
||||
it 'should send an update to mongo', (done)->
|
||||
|
|
|
@ -11,6 +11,7 @@ describe "UserLocator", ->
|
|||
@UserLocator = SandboxedModule.require modulePath, requires:
|
||||
"../../infrastructure/mongojs": db: @db = { users: {} }
|
||||
"metrics-sharelatex": timeAsyncMethod: sinon.stub()
|
||||
'logger-sharelatex' : { log: sinon.stub() }
|
||||
@db.users =
|
||||
findOne : sinon.stub().callsArgWith(1, null, @user)
|
||||
|
||||
|
|
|
@ -96,7 +96,6 @@ describe "UserRegistrationHandler", ->
|
|||
it "should return email registered in the error if there is a non holdingAccount there", (done)->
|
||||
@User.findOne.callsArgWith(1, null, @user = {holdingAccount:false})
|
||||
@handler.registerNewUser @passingRequest, (err, user)=>
|
||||
console.log err, user
|
||||
err.should.deep.equal new Error("EmailAlreadyRegistered")
|
||||
user.should.deep.equal @user
|
||||
done()
|
||||
|
|
Loading…
Reference in a new issue