Merge pull request #44 from sharelatex/sk-node-6

Upgrade to Node6
This commit is contained in:
Shane Kilkelly 2017-08-31 09:51:07 +01:00 committed by GitHub
commit b959e33b4b
9 changed files with 31 additions and 2287 deletions

View file

@ -1 +1 @@
0.10.22
6.11.2

File diff suppressed because it is too large Load diff

View file

@ -3,34 +3,35 @@
"version": "0.1.4",
"description": "An API for saving and compressing individual document updates into a browsable history",
"repository": {
"type": "git",
"type": "git",
"url": "https://github.com/sharelatex/track-changes-sharelatex.git"
},
"dependencies": {
"JSONStream": "^1.0.4",
"async": "~0.2.10",
"aws-sdk": "^2.102.0",
"bson": "^0.4.20",
"byline": "^4.2.1",
"cli": "^0.6.6",
"express": "3.3.5",
"heap": "^0.2.6",
"line-reader": "^0.2.4",
"mongojs": "^1.4.1",
"settings-sharelatex": "git+https://github.com/sharelatex/settings-sharelatex.git#v1.0.0",
"logger-sharelatex": "git+https://github.com/sharelatex/logger-sharelatex.git#v1.5.6",
"metrics-sharelatex": "git+https://github.com/sharelatex/metrics-sharelatex.git#v1.7.1",
"mongo-uri": "^0.1.2",
"mongojs": "2.4.0",
"redis": "~0.10.1",
"redis-sharelatex": "git+https://github.com/sharelatex/redis-sharelatex.git#v1.0.2",
"request": "~2.33.0",
"requestretry": "^1.12.0",
"redis-sharelatex": "git+https://github.com/sharelatex/redis-sharelatex.git#v1.0.2",
"redis": "~0.10.1",
"underscore": "~1.7.0",
"mongo-uri": "^0.1.2",
"s3-streams": "^0.3.0",
"JSONStream": "^1.0.4",
"heap": "^0.2.6",
"settings-sharelatex": "git+https://github.com/sharelatex/settings-sharelatex.git#v1.0.0",
"underscore": "~1.7.0",
"v8-profiler": "^5.6.5"
},
"devDependencies": {
"chai": "~1.9.0",
"sinon": "~1.8.2",
"chai": "~4.1.1",
"sinon": "~3.2.1",
"sandboxed-module": "~0.3.0",
"grunt-execute": "~0.1.5",
"grunt-contrib-clean": "~0.5.0",
@ -38,7 +39,7 @@
"grunt": "~0.4.2",
"grunt-available-tasks": "~0.4.2",
"grunt-contrib-coffee": "~0.10.1",
"bunyan": "~0.22.1",
"bunyan": "~2.0.2",
"grunt-bunyan": "~0.5.0",
"grunt-forever": "~0.4.2",
"timekeeper": "0.0.4",

View file

@ -39,7 +39,8 @@ describe "MongoAWS", ->
beforeEach (done) ->
@awssdk.config = { update: sinon.stub() }
@awssdk.S3 = sinon.stub()
@S3S.WriteStream = MemoryStream.createWriteStream
@S3S.WriteStream = () ->
MemoryStream.createWriteStream()
@db.docHistory = {}
@db.docHistory.findOne = sinon.stub().callsArgWith(1, null, {"pack":"hello"})

View file

@ -31,7 +31,7 @@ describe "DocumentUpdaterManager", ->
@request.get.calledWith(url).should.equal true
it "should call the callback with the content and version", ->
@callback.calledWith(null, @lines.join("\n"), @version, @ops).should.equal true
@callback.calledWith(null, @lines.join("\n"), @version).should.equal true
describe "when the document updater API returns an error", ->
beforeEach ->
@ -48,7 +48,7 @@ describe "DocumentUpdaterManager", ->
it "should return the callback with an error", ->
@callback
.calledWith(new Error("doc updater returned failure status code: 500"))
.calledWith(sinon.match.has('message', "doc updater returned a non-success status code: 500"))
.should.equal true
describe "setDocument", ->
@ -91,5 +91,5 @@ describe "DocumentUpdaterManager", ->
it "should return the callback with an error", ->
@callback
.calledWith(new Error("doc updater returned failure status code: 500"))
.should.equal true
.calledWith(sinon.match.has('message', "doc updater returned a non-success status code: 500"))
.should.equal true

View file

@ -194,5 +194,5 @@ describe "LockManager", ->
@LockManager.releaseLock @key, @lockValue, @callback
it 'should return an error if the lock has expired', ->
@callback.calledWith(new Error("tried to release timed out lock")).should.equal true
@callback.calledWith(sinon.match.has('message', "tried to release timed out lock")).should.equal true

View file

@ -316,7 +316,7 @@ describe "PackManager", ->
it "should call the callback", ->
@callback.called.should.equal true
it "should return an error", ->
@callback.calledWith(new Error()).should.equal true
@callback.calledWith(sinon.match.has('message')).should.equal true
describe "when an archive is completed", ->
beforeEach ->
@ -326,17 +326,17 @@ describe "PackManager", ->
it "should call the callback", ->
@callback.called.should.equal true
it "should return an error", ->
@callback.calledWith(new Error()).should.equal true
@callback.calledWith(sinon.match.has('message')).should.equal true
describe "when the archive has not started or completed", ->
beforeEach ->
@db.docHistoryIndex =
findOne: sinon.stub().callsArgWith(2, null, {})
@PackManager.checkArchiveNotInProgress @project_id, @doc_id, @pack_id, @callback
it "should call the callback", ->
it "should call the callback with no error", ->
@callback.called.should.equal true
it "should return with no error", ->
@callback.calledWith(undefined).should.equal true
(typeof @callback.lastCall.args[0]).should.equal 'undefined'
# describe "setTTLOnArchivedPack", ->
# beforeEach ->

View file

@ -135,7 +135,7 @@ describe "UpdatesManager", ->
it "should call the callback with an error", ->
@callback
.calledWith(new Error("Tried to apply raw op at version 13 to last compressed update with version 11"))
.calledWith(sinon.match.has('message', "Tried to apply raw op at version 13 to last compressed update with version 11 from unknown time"))
.should.equal true
it "should not insert any update into mongo", ->
@ -148,7 +148,7 @@ describe "UpdatesManager", ->
it "should call the callback with an error", ->
@callback
.calledWith(new Error)
.calledWith(sinon.match.has('message'))
.should.equal true
it "should not insert any update into mongo", ->

View file

@ -64,12 +64,12 @@ describe "WebApiManager", ->
describe "when the web returns a failure error code", ->
beforeEach ->
@request.get = sinon.stub().callsArgWith(1, null, { statusCode: 500 }, "")
@request.get = sinon.stub().callsArgWith(1, null, { statusCode: 500, attempts: 42}, "")
@WebApiManager.getUserInfo @user_id, @callback
it "should return the callback with an error", ->
@callback
.calledWith(new Error("web returned failure status code: 500"))
.calledWith(sinon.match.has('message', "web returned a non-success status code: 500 (attempts: 42)"))
.should.equal true
describe "when the user cannot be found", ->
@ -114,10 +114,10 @@ describe "WebApiManager", ->
describe "when the web returns a failure error code", ->
beforeEach ->
@request.get = sinon.stub().callsArgWith(1, null, { statusCode: 500 }, "")
@request.get = sinon.stub().callsArgWith(1, null, { statusCode: 500, attempts: 42 }, "")
@WebApiManager.getProjectDetails @project_id, @callback
it "should return the callback with an error", ->
@callback
.calledWith(new Error("web returned failure status code: 500"))
.calledWith(sinon.match.has('message', "web returned a non-success status code: 500 (attempts: 42)"))
.should.equal true