-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
test: Complete all matching operations #2712
Conversation
Using the unfied spec test schema this scaffolding outlines the structure of a unified runner. Most tests are skipped by the runOn requirements or not implemented errors thrown by empty operation functions. NODE-2287
Adds special operations support i.e. $$unsetOrMatches for testing nested schema equality of results and events. Adds Recursive equality test that tracks the path into the object it is testing for ease of error tracing. Enable Change Stream tests with the repurposed EventsCollector class to iterate change events. Adds find, insertMany, iterateUntilDocumentOrError, and failPoint operations. NODE-2287
5edf26a
to
a874e5c
Compare
Adds a check that asserts when at a recursion depth greater than 1 that documents do not have extra keys
} | ||
|
||
const TYPE_MAP = new Map(); | ||
function typeof_double(actual): actual is number | Double { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just out of curiosity is there a pattern of using snake case in typescript? I hadn't seen this before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we perhaps have the functions inline in the Map.set calls? E.g.
TYPE_MAP.set('double', function (actual): actual is number | Double {
return typeof actual === 'number' || actual._bsontype === 'Double';
});
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inlined them to arrow functions, I over prepared here for more complex logic than was actually needed 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, nice re-use of EventCollector
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Adds special operations support i.e. $$unsetOrMatches for testing nested schema equality of results and events. Adds Recursive equality test that tracks the path into the object it is testing for ease of error tracing. Enable Change Stream tests with the repurposed EventsCollector class to iterate change events. Adds find, insertMany, iterateUntilDocumentOrError, and failPoint operations. NODE-2287
Adds special operations support i.e. $$unsetOrMatches for testing
nested schema equality of results and events. Adds Recursive
equality test that tracks the path into the object it is testing
for ease of error tracing. Enable Change Stream tests with the
repurposed EventsCollector class to iterate change events. Adds
find, insertMany, iterateUntilDocumentOrError, and failPoint operations.
NODE-2287