Skip to content

Commit

Permalink
Less strict output matching
Browse files Browse the repository at this point in the history
  • Loading branch information
gagik committed Oct 7, 2024
1 parent 0417c4a commit 270a98f
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions packages/e2e-tests/test/e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1964,29 +1964,23 @@ describe('e2e', function () {

it('should return the current operation and clear when it is complete', async function () {
const currentCommand = helperShell.executeLine(
`db.coll.find({$where: function() { sleep(${OPERATION_TIME}) }}).projection({test: 1})`
`db.coll.find({$where: function() { sleep(${OPERATION_TIME}) }}).projection({testProjection: 1})`
);
helperShell.assertNoErrors();
await sleep(CURRENT_OP_WAIT_TIME);
let currentOpCall = await currentOpShell.executeLine(`db.currentOp()`);

currentOpShell.assertNoErrors();
expect(currentOpCall).to.include("find: 'coll'");
expect(currentOpCall).to.include(
`filter: { '$where': Code('function() { sleep(${OPERATION_TIME}) }') }`
);
expect(currentOpCall).to.include('projection: { test: 1 }');
expect(currentOpCall).to.include(`sleep(${OPERATION_TIME})`);
expect(currentOpCall).to.include('testProjection');

await currentCommand;

currentOpCall = await currentOpShell.executeLine(`db.currentOp()`);

currentOpShell.assertNoErrors();
expect(currentOpCall).not.to.include("find: 'coll'");
expect(currentOpCall).not.to.include(
`filter: { '$where': Code('function() { sleep(${OPERATION_TIME}) }') }`
);
expect(currentOpCall).not.to.include('projection: { test: 1 }');
expect(currentOpCall).not.to.include(`sleep(${OPERATION_TIME})`);
expect(currentOpCall).not.to.include('testProjection');
});

it('should work when the operation contains regex', async function () {
Expand Down

0 comments on commit 270a98f

Please sign in to comment.