Skip to content

Conversation

@emadum
Copy link
Contributor

@emadum emadum commented May 25, 2021

@emadum emadum marked this pull request as ready for review May 25, 2021 21:11
@emadum emadum requested review from a team, dariakp, durran and nbbeeken and removed request for a team May 25, 2021 21:12
@dariakp dariakp changed the title feat(bulk): add arrayFilters builder to bulk FindOperators feat(NODE-2751): add arrayFilters builder to bulk FindOperators May 26, 2021
bulk.execute(err => {
expect(err).to.not.exist;
expect(events).to.be.an('array').with.length(1);
expect(events[0]).property('commandName').to.equal('update');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a note: the property assertions can take the property name and value to compare directly, so this line is equivalent to expect(events[0]).to.have.property('commandName', 'update'); and if you go a step further and use the nested keyword, you could say expect(events).to.have.nested.property('0.commandName', 'update')

these are personal preferences, I just wanted to make you aware of the options in case any of them appeal to you

also be careful with the length assertion, since it can't be reliably chained in all cases (e.g., you can't chain it off a), so chai's own docs recommend to use lengthOf as a general rule, since that does work exactly as expected in all cases

@emadum emadum merged commit d099622 into 4.0 May 28, 2021
@emadum emadum deleted the NODE-2751/bulk-arrayfilters branch May 28, 2021 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants