Skip to content

Commit daf432b

Browse files
committed
review fixes
1 parent 33aaf5b commit daf432b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

test/unit/assorted/server_discovery_and_monitoring.spec.test.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,6 @@ function normalizeServerDescription(serverDescription) {
271271
// it as `Unknown`.
272272
serverDescription.type = 'Unknown';
273273
}
274-
//serverDescription.error = serverDescription?.error?.message;
275274

276275
return serverDescription;
277276
}
@@ -475,9 +474,11 @@ function assertTopologyDescriptionOutcomeExpectations(
475474
} else if (expectedKey !== 'error') {
476475
expect(actualServer).to.have.deep.property(expectedKey, expectedValue);
477476
} else {
478-
// pull the message off the error if it is present
479-
expect(actualServer).to.have.property(expectedKey).instanceof(MongoError);
480-
expect(actualServer).property(expectedKey).property('message').includes(expectedValue);
477+
expect(typeof expectedValue).to.equal('string');
478+
expect(actualServer)
479+
.to.have.property(expectedKey)
480+
.instanceof(MongoError)
481+
.to.match(new RegExp(expectedValue as string));
481482
}
482483
}
483484
}

0 commit comments

Comments
 (0)