Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
esbenp committed Nov 13, 2017
1 parent fe56e64 commit 4ac547b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions test/api.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ describe('api: POST /', function () {
queue = function () {
return {
addToQueue: function() {
return {
code: '001',
error: true
}
return new Promise(function (resolve) {
resolve({
code: '001',
error: true
})
})
}
}
}
Expand All @@ -50,7 +52,7 @@ describe('api: POST /', function () {
var meta = {id: 1}

var addToQueue = sinon.stub()
addToQueue.onCall(0).returns({ id: '1234' })
addToQueue.onCall(0).returns(new Promise(function (resolve) { resolve({ id: '1234' }) }))

var queue = function() {
return {
Expand Down
2 changes: 1 addition & 1 deletion test/queue.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ describe('queue : processing', function() {
assert(response.completed, true)

var pingArgs = pingStub.args[0]
assert.equal(pingArgs[0], job)
assert.equal(pingArgs[0].id, job.id)
assert.equal(pingArgs[1], webhookOptions)

pingStub.restore()
Expand Down

0 comments on commit 4ac547b

Please sign in to comment.