Skip to content

Commit 91e3365

Browse files
fix cursor test
1 parent 4ea5d69 commit 91e3365

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

test/integration/crud/misc_cursors.test.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1708,7 +1708,6 @@ describe('Cursor', function () {
17081708
expect(cursor).property('closed', false);
17091709

17101710
const willClose = once(cursor, 'close');
1711-
const willEnd = once(stream, 'close');
17121711

17131712
const dataEvents = on(stream, 'data');
17141713

@@ -1722,16 +1721,12 @@ describe('Cursor', function () {
17221721
// After 5 successful data events, destroy stream
17231722
stream.destroy();
17241723

1725-
// We should get a a close event on the stream and a close event on the cursor
1726-
// We should **not** get an 'error' event,
1724+
// We should get a close event on the stream and a close event on the cursor
1725+
// We should **not** get an 'error' or an 'end' event,
17271726
// the following will throw if either stream or cursor emitted an 'error' event
1728-
await Promise.race([
1729-
willEnd,
1730-
sleep(100, { ref: false }).then(() => Promise.reject(new Error('end event never emitted')))
1731-
]);
17321727
await Promise.race([
17331728
willClose,
1734-
sleep(100, { ref: false }).then(() => Promise.reject(new Error('close event never emitted')))
1729+
sleep(100).then(() => Promise.reject(new Error('close event never emitted')))
17351730
]);
17361731
});
17371732

0 commit comments

Comments
 (0)