Skip to content

Commit

Permalink
fix(subscriber): pass message to ack
Browse files Browse the repository at this point in the history
  • Loading branch information
ygrishajev committed Feb 5, 2020
1 parent 3d7870a commit 7f5e7fd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "rxamqp",
"version": "0.2.13",
"version": "0.2.14",
"description": "Library for easy amqplib configuration and usage",
"main": "./src/index.js",
"scripts": {
"start": "nodemon ./src/index.js",
"start:test": "nodemon ./src/test.js",
"lint": "eslint src",
"test": "jest --coverage --collectCoverageFrom --forceExit spec",
"test:watch": "nodemon --watch . --exec 'jest --runInBand spec'",
"test:watch": "jest --watchAll --runInBand",
"playground": "nodemon ./src/test.js"
},
"author": {
Expand All @@ -17,7 +17,7 @@
},
"repository": {
"type": "git",
"url": "https://github.com/ygrishajev/amqpRx"
"url": "https://github.com/ygrishajev/rxamqp"
},
"license": "MIT",
"keywords": [
Expand Down
2 changes: 0 additions & 2 deletions spec/client.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ afterEach(() => client.shutdown())

describe('Client', () => {
test('#publish message payload is properly delivered subscriber', () => {
expect.assertions(1)

return new Promise(resolve => {
use((msg, ctx) => {
ctx.ack().then(() => resolve(msg))
Expand Down
2 changes: 1 addition & 1 deletion src/subscriber.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ module.exports = context => {
data: payload,
status: status || 200
}, message, { ack: true }),
ack,
ack: () => ack(message),
reject: (requeue = false) => {
context.events.emit('event.nack', message)
return context.channel.reject(message, requeue)
Expand Down

0 comments on commit 7f5e7fd

Please sign in to comment.