Skip to content

Commit 2b49d3e

Browse files
asdf
1 parent eaf1f62 commit 2b49d3e

File tree

1 file changed

+33
-34
lines changed

1 file changed

+33
-34
lines changed

test/integration/crud/find.test.js

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -496,50 +496,49 @@ describe('Find', function () {
496496
}
497497
});
498498

499-
for (let i = 0; i < 500; ++i) {
500-
it('shouldCorrectlyPerformFindsWithHintTurnedOn' + i, async function () {
501-
const configuration = this.configuration;
502-
client = configuration.newClient(configuration.writeConcernMax(), { maxPoolSize: 1 });
503-
await client.connect();
499+
it('shouldCorrectlyPerformFindsWithHintTurnedOn', async function () {
500+
const configuration = this.configuration;
501+
client = configuration.newClient(configuration.writeConcernMax(), { maxPoolSize: 1 });
502+
await client.connect();
504503

505-
const db = client.db(configuration.db);
506-
const collection = await db.createCollection('test_hint');
504+
const db = client.db(configuration.db);
505+
const collection = await db.createCollection('test_hint');
507506

508-
await collection.insert({ a: 1 }, configuration.writeConcernMax());
507+
await collection.deleteMany({});
508+
await collection.insert({ a: 1 }, configuration.writeConcernMax());
509509

510-
await db.createIndex(collection.collectionName, 'a', configuration.writeConcernMax());
510+
await db.createIndex(collection.collectionName, 'a', configuration.writeConcernMax());
511511

512-
expect(
513-
await collection
514-
.find({ a: 1 }, { hint: 'a' })
515-
.toArray()
516-
.catch(e => e)
517-
).to.be.instanceOf(Error);
512+
expect(
513+
await collection
514+
.find({ a: 1 }, { hint: 'a' })
515+
.toArray()
516+
.catch(e => e)
517+
).to.be.instanceOf(Error);
518518

519-
// Test with hint as array
520-
expect(await collection.find({ a: 1 }, { hint: ['a'] }).toArray()).to.have.lengthOf(1);
519+
// Test with hint as array
520+
expect(await collection.find({ a: 1 }, { hint: ['a'] }).toArray()).to.have.lengthOf(1);
521521

522-
// Test with hint as object
523-
expect(await collection.find({ a: 1 }, { hint: { a: 1 } }).toArray()).to.have.lengthOf(1);
522+
// Test with hint as object
523+
expect(await collection.find({ a: 1 }, { hint: { a: 1 } }).toArray()).to.have.lengthOf(1);
524524

525-
// Modify hints
526-
collection.hint = 'a_1';
527-
expect(collection.hint).to.equal('a_1');
528-
expect(await collection.find({ a: 1 }).toArray()).to.have.lengthOf(1);
525+
// Modify hints
526+
collection.hint = 'a_1';
527+
expect(collection.hint).to.equal('a_1');
528+
expect(await collection.find({ a: 1 }).toArray()).to.have.lengthOf(1);
529529

530-
collection.hint = ['a'];
531-
expect(collection.hint['a']).to.equal(1);
532-
expect(await collection.find({ a: 1 }).toArray()).to.have.lengthOf(1);
530+
collection.hint = ['a'];
531+
expect(collection.hint['a']).to.equal(1);
532+
expect(await collection.find({ a: 1 }).toArray()).to.have.lengthOf(1);
533533

534-
collection.hint = { a: 1 };
535-
expect(collection.hint['a']).to.equal(1);
536-
expect(await collection.find({ a: 1 }).toArray()).to.have.lengthOf(1);
534+
collection.hint = { a: 1 };
535+
expect(collection.hint['a']).to.equal(1);
536+
expect(await collection.find({ a: 1 }).toArray()).to.have.lengthOf(1);
537537

538-
collection.hint = null;
539-
expect(collection.hint).to.be.null;
540-
expect(await collection.find({ a: 1 }).toArray()).to.have.lengthOf(1);
541-
});
542-
}
538+
collection.hint = null;
539+
expect(collection.hint).to.be.undefined;
540+
expect(await collection.find({ a: 1 }).toArray()).to.have.lengthOf(1);
541+
});
543542

544543
it('shouldCorrectlyPerformFindByObjectId', {
545544
metadata: {

0 commit comments

Comments
 (0)