MCPcopy
hub / github.com/mongodb/node-mongodb-native / findMatchingEvents

Function findMatchingEvents

test/tools/spec-runner/context.js:242–249  ·  view source on GitHub ↗
(context, eventName)

Source from the content-addressed store, hash-verified

240}
241
242function findMatchingEvents(context, eventName) {
243 const allEvents = context.sdamEvents.concat(context.cmapEvents);
244 return eventName === 'ServerMarkedUnknownEvent'
245 ? context.sdamEvents
246 .filter(event => event.constructor.name === 'ServerDescriptionChangedEvent')
247 .filter(event => event.newDescription.type === 'Unknown')
248 : allEvents.filter(event => event.constructor.name.match(new RegExp(eventName)));
249}
250
251module.exports = { TestRunnerContext };

Callers 2

checkForEventMethod · 0.85
assertEventCountMethod · 0.85

Calls 2

matchMethod · 0.80
filterMethod · 0.45

Tested by

no test coverage detected