jstests/noPassthrough/change_stream_resume_before_add_shard.js
// function also pushes all observed changes into the supplied 'eventList' array.
function also pushes all observed changes into the supplied 'eventList' array.
function also pushes all observed changes into the supplied ' eventList ' array .
function assertAllEventsObserved(changeStream, expectedDocs, eventList) {
    for (let expectedDoc of expectedDocs) {
        assert.soon(() => changeStream.hasNext());
        const nextEvent = changeStream.next();
        assert.eq(nextEvent.fullDocument, expectedDoc);
        if (eventList) {
            eventList.push(nextEvent);
        }
    }
}
function assertAllEventsObserved ( changeStream , expectedDocs , eventList ) { for ( let expectedDoc of expectedDocs ) { assert . soon ( ( ) => changeStream . hasNext ( ) ) ; const nextEvent = changeStream . next ( ) ; assert . eq ( nextEvent . fullDocument , expectedDoc ) ; if ( eventList ) { eventList . push ( nextEvent ) ; } } }
function also pushes all observed changes into the supplied 'eventList' array.
function also pushes all observed changes into the supplied ' eventList ' array .