summaryrefslogtreecommitdiff
path: root/jstests/libs/change_stream_util.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/libs/change_stream_util.js')
-rw-r--r--jstests/libs/change_stream_util.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/jstests/libs/change_stream_util.js b/jstests/libs/change_stream_util.js
index 71a56f3ffe8..8c779cbf0f5 100644
--- a/jstests/libs/change_stream_util.js
+++ b/jstests/libs/change_stream_util.js
@@ -193,6 +193,13 @@ function ChangeStreamTest(_db, name = "ChangeStreamTest") {
"Expected change's size must match expected number of changes");
}
+ // Convert 'expectedChanges' to an array, even if it contains just a single element.
+ if (expectedChanges !== undefined && !(expectedChanges instanceof Array)) {
+ let arrayVersion = new Array;
+ arrayVersion.push(expectedChanges);
+ expectedChanges = arrayVersion;
+ }
+
// Set the expected number of changes based on the size of the expected change list.
if (expectedNumChanges === undefined) {
assert.neq(expectedChanges, undefined);