Skip to content

Commit 8c19b28

Browse files
committed
chore: fix lint and remove exhaust test
1 parent c542c95 commit 8c19b28

File tree

2 files changed

+2
-61
lines changed

2 files changed

+2
-61
lines changed

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ export type {
264264
export type { LEGAL_TCP_SOCKET_OPTIONS, LEGAL_TLS_SOCKET_OPTIONS, Stream } from './cmap/connect';
265265
export type {
266266
CommandOptions,
267+
Connection,
267268
ConnectionEvents,
268269
ConnectionOptions,
269270
DestroyOptions,

test/integration/connection-monitoring-and-pooling/connection.test.ts

Lines changed: 1 addition & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ describe('Connection', function () {
3131
return setupDatabase(this.configuration);
3232
});
3333

34-
describe('Connection - functional/cmap', function () {
34+
describe('Connection.command', function () {
3535
it('should execute a command against a server', {
3636
metadata: { requires: { apiVersion: false, topology: '!load-balanced' } },
3737
test: async function () {
@@ -79,66 +79,6 @@ describe('Connection', function () {
7979
}
8080
}
8181
});
82-
83-
it('should support calling back multiple times on exhaust commands', {
84-
metadata: {
85-
requires: { apiVersion: false, mongodb: '>=4.2.0', topology: ['single'] }
86-
},
87-
test: function (done) {
88-
const namespace = ns(`${this.configuration.db}.$cmd`);
89-
const connectOptions: Partial<ConnectionOptions> = {
90-
connectionType: Connection,
91-
...this.configuration.options,
92-
metadata: makeClientMetadata({ driverInfo: {} })
93-
};
94-
95-
connect(connectOptions as any as ConnectionOptions, (err, conn) => {
96-
expect(err).to.not.exist;
97-
this.defer(_done => conn.destroy(_done));
98-
99-
const documents = Array.from(Array(10000), (_, idx) => ({
100-
test: Math.floor(Math.random() * idx)
101-
}));
102-
103-
conn.command(namespace, { drop: 'test' }, undefined, () => {
104-
conn.command(namespace, { insert: 'test', documents }, undefined, (err, res) => {
105-
expect(err).to.not.exist;
106-
expect(res).nested.property('n').to.equal(documents.length);
107-
108-
let totalDocumentsRead = 0;
109-
conn.command(
110-
namespace,
111-
{ find: 'test', batchSize: 100 },
112-
undefined,
113-
(err, result) => {
114-
expect(err).to.not.exist;
115-
expect(result).nested.property('cursor').to.exist;
116-
const cursor = result.cursor;
117-
totalDocumentsRead += cursor.firstBatch.length;
118-
119-
conn.command(
120-
namespace,
121-
{ getMore: cursor.id, collection: 'test', batchSize: 100 },
122-
{ exhaustAllowed: true },
123-
(err, result) => {
124-
expect(err).to.not.exist;
125-
expect(result).nested.property('cursor').to.exist;
126-
const cursor = result.cursor;
127-
totalDocumentsRead += cursor.nextBatch.length;
128-
129-
if (cursor.id === 0 || cursor.id.isZero()) {
130-
expect(totalDocumentsRead).to.equal(documents.length);
131-
done();
132-
}
133-
}
134-
);
135-
}
136-
);
137-
});
138-
});
139-
});
140-
}
141-
});
14282
});
14383

14484
describe('Connection - functional', function () {

0 commit comments

Comments
 (0)