Skip to content

Commit 10cb7b4

Browse files
committed
Revert "test: fix integration test"
This reverts commit 9edc40f.
1 parent 9edc40f commit 10cb7b4

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

test/integration/crud/aggregation.test.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -640,29 +640,31 @@ describe('Aggregation', function () {
640640
expect(error).to.be.instanceOf(MongoInvalidArgumentError);
641641
});
642642

643-
it(`should succeed if you try to use explain flag with { readConcern: { level: 'local' }, writeConcern: { j: true } }`, async function () {
643+
it(`should fail if you try to use explain flag with { readConcern: { level: 'local' }, writeConcern: { j: true } }`, async function () {
644644
const db = client.db();
645645

646646
const collection = db.collection('foo');
647647
Object.assign(collection.s, { writeConcern: { j: true } });
648-
const result = await collection
648+
const error = await collection
649649
.aggregate([{ $project: { _id: 0 } }, { $out: 'bar' }], { explain: true })
650-
.toArray();
650+
.toArray()
651+
.catch(error => error);
651652

652-
expect(result).to.not.be.null;
653+
expect(error).to.be.instanceOf(MongoInvalidArgumentError);
653654
});
654655

655-
it('should succeed if you try to use explain flag with { writeConcern: { j: true } }', async function () {
656+
it('should fail if you try to use explain flag with { writeConcern: { j: true } }', async function () {
656657
const db = client.db();
657658

658659
const collection = db.collection('foo');
659660
Object.assign(collection.s, { writeConcern: { j: true } });
660661

661-
const result = await collection
662+
const error = await collection
662663
.aggregate([{ $project: { _id: 0 } }, { $out: 'bar' }], { explain: true })
663-
.toArray();
664+
.toArray()
665+
.catch(error => error);
664666

665-
expect(result).to.not.be.null;
667+
expect(error).to.be.instanceOf(MongoInvalidArgumentError);
666668
});
667669

668670
it('should ensure MaxTimeMS is correctly passed down into command execution when using a cursor', function (done) {

0 commit comments

Comments
 (0)