Skip to content

Commit

Permalink
fixed identical test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
malikj2000 committed Jun 15, 2023
1 parent 18b169c commit 2601c7b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/integration/crud/explain.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,21 +77,24 @@ describe('Explain', function () {
});

context('when explain is set to false', () => {
it('only queryPlanner property is used in explain result', async function () {
it('deleteOne only returns queryPlanner property in explain result', async function () {
const explanation = await collection.deleteOne({ a: 1 }, { explain: false });
expect(explanation).property('queryPlanner').to.exist;
expect(explanation).to.not.have.property('executionStats');
});

it('find returns "queryPlanner" explain result specified on cursor', async function () {
const explanation = await collection.find({ a: 1 }).explain(false);
expect(explanation).property('queryPlanner').to.exist;
expect(explanation).to.not.have.property('executionStats');
});
});

context('when explain is set to "queryPlanner"', () => {
it('only queryPlanner property is used in explain result', async function () {
it('deleteOne returns only queryPlanner property in explain result', async function () {
const explanation = await collection.deleteOne({ a: 1 }, { explain: 'queryPlanner' });
expect(explanation).property('queryPlanner').to.exist;
expect(explanation).to.not.have.property('executionStats');
});

it('findOneAndReplace returns queryPlanner explain result', async function () {
Expand Down

0 comments on commit 2601c7b

Please sign in to comment.