Skip to content

chore: improve assertion with expected path #4474

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Mar 19, 2025
Merged

Conversation

nbbeeken
Copy link
Contributor

Description

What is changing?

Is there new documentation needed for these changes?

What is the motivation for this change?

A test failed and it isn't clear what part of the expectation wasn't an object.

https://spruce.mongodb.com/task/mongo_node_driver_next_rhel80_large_Node20_test_7.0_sharded_cluster_91d235221cc42a49bcfa85e428f83d8e6ba258d0_75c01e57abc470e785838d3c6dd0a8c0_25_03_18_15_22_09/logs?execution=0&sortBy=STATUS&sortDir=ASC

Double check the following

  • Ran npm run check:lint script
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: type(NODE-xxxx)[!]: description
    • Example: feat(NODE-1234)!: rewriting everything in coffeescript
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

@nbbeeken nbbeeken requested a review from a team as a code owner March 18, 2025 18:28
@nbbeeken nbbeeken force-pushed the improve-error-message branch from 1541409 to 30a4d63 Compare March 18, 2025 18:30
@nbbeeken nbbeeken force-pushed the improve-error-message branch from 72b19a7 to 4bf1384 Compare March 18, 2025 21:21
@baileympearson baileympearson self-assigned this Mar 19, 2025
@baileympearson baileympearson added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Mar 19, 2025
Copy link
Contributor

@baileympearson baileympearson left a comment

Choose a reason for hiding this comment

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

assertion is much more actionable:

AssertionError: Expected actual ({ _id: 1, time: 2019-03-18T22:53:50.482Z }) to be an array at: events[2].commandStartedEvent.command.documents[0]: expected { _id: 1, time: 2019-03-18T22:53:50.482Z } to satisfy [Function]

@nbbeeken nbbeeken requested a review from baileympearson March 19, 2025 14:47
@baileympearson baileympearson merged commit af30db9 into main Mar 19, 2025
27 of 30 checks passed
@baileympearson baileympearson deleted the improve-error-message branch March 19, 2025 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Primary Review In Review with primary reviewer, not yet ready for team's eyes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants