Skip to content

Commit 1e84249

Browse files
authored
fix(tests): cleanup post fix
1 parent af45095 commit 1e84249

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/test/integration-tests.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,18 +128,20 @@ describe('Subscribe to buffer', () => {
128128
// when using messageBuffer, with redis instance the channel name is not a string but a buffer
129129
const pubSub = new RedisPubSub({ messageEventName: 'messageBuffer'});
130130
const payload = 'This is amazing';
131+
let subId;
131132
pubSub.subscribe('Posts', message => {
132133
try {
133134
expect(message).to.be.instanceOf(Buffer);
134135
expect(message.toString('utf-8')).to.be.equal(payload);
136+
pubSub.unsubscribe(subId);
135137
done();
136138
} catch (e) {
137139
done(e);
138140
}
139141
}).then(async subId => {
140142
try {
141143
await pubSub.publish('Posts', Buffer.from(payload, 'utf-8'));
142-
// pubSub.unsubscribe(subId);
144+
subId = subId;
143145
} catch (e) {
144146
done(e);
145147
}

0 commit comments

Comments
 (0)