Skip to content

Commit

Permalink
fix(tests): remove unsubscribe altogether
Browse files Browse the repository at this point in the history
  • Loading branch information
davidyaha authored May 2, 2024
1 parent e10f293 commit 4f4fd77
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/test/integration-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,19 +128,17 @@ describe('Subscribe to buffer', () => {
// when using messageBuffer, with redis instance the channel name is not a string but a buffer
const pubSub = new RedisPubSub({ messageEventName: 'messageBuffer'});
const payload = 'This is amazing';
let subId;

pubSub.subscribe('Posts', message => {
try {
expect(message).to.be.instanceOf(Buffer);
expect(message.toString('utf-8')).to.be.equal(payload);
pubSub.unsubscribe(subId);
done();
} catch (e) {
done(e);
}
}).then(async subId => {
try {
subId = subId;
await pubSub.publish('Posts', Buffer.from(payload, 'utf-8'));
} catch (e) {
done(e);
Expand Down

0 comments on commit 4f4fd77

Please sign in to comment.