|
@@ -912,7 +912,7 @@ describe('ClsiManager', function () {
|
|
|
|
|
|
|
|
describe('_postToClsi', function () {
|
|
describe('_postToClsi', function () {
|
|
|
beforeEach(function () {
|
|
beforeEach(function () {
|
|
|
- this.req = { compile: { options: { timeout: 42 } } }
|
|
|
|
|
|
|
+ this.req = { mock: 'req', compile: {} }
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
describe('successfully', function () {
|
|
describe('successfully', function () {
|
|
@@ -941,7 +941,6 @@ describe('ClsiManager', function () {
|
|
|
method: 'POST',
|
|
method: 'POST',
|
|
|
url,
|
|
url,
|
|
|
json: this.req,
|
|
json: this.req,
|
|
|
- timeout: 42 * 1000 + 120 * 1000,
|
|
|
|
|
})
|
|
})
|
|
|
.should.equal(true)
|
|
.should.equal(true)
|
|
|
})
|
|
})
|
|
@@ -974,27 +973,6 @@ describe('ClsiManager', function () {
|
|
|
this.callback.should.have.been.calledWith(sinon.match.instanceOf(Error))
|
|
this.callback.should.have.been.calledWith(sinon.match.instanceOf(Error))
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
-
|
|
|
|
|
- describe('when the CLSI request times out', function () {
|
|
|
|
|
- beforeEach(function () {
|
|
|
|
|
- this.ClsiManager._makeRequest = sinon
|
|
|
|
|
- .stub()
|
|
|
|
|
- .callsArgWith(2, { code: 'ESOCKETTIMEDOUT' }, null, null)
|
|
|
|
|
- this.ClsiManager._postToClsi(
|
|
|
|
|
- this.project_id,
|
|
|
|
|
- this.user_id,
|
|
|
|
|
- this.req,
|
|
|
|
|
- 'standard',
|
|
|
|
|
- this.callback
|
|
|
|
|
- )
|
|
|
|
|
- })
|
|
|
|
|
-
|
|
|
|
|
- it('should call the callback with a timed out response', function () {
|
|
|
|
|
- this.callback.should.have.been.calledWith(null, {
|
|
|
|
|
- compile: { status: 'timedout' },
|
|
|
|
|
- })
|
|
|
|
|
- })
|
|
|
|
|
- })
|
|
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
describe('wordCount', function () {
|
|
describe('wordCount', function () {
|