Skip to content

Commit 8a39c1d

Browse files
committed
test: no longer look for type in cmap spec test runner
The CMAP spec test runner was assuming a particular shape of error reported, which included a `type` field which is only useful for testing. In order to preserve an order that would actually be useful for users, we only compare error messages now.
1 parent d88ada6 commit 8a39c1d

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

test/unit/cmap/connection_pool.test.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -441,12 +441,10 @@ describe('Connection Pool', function() {
441441
const actualEvents = poolEvents.filter(ev => ignoreEvents.indexOf(ev.type) < 0);
442442

443443
if (expectedError) {
444-
if (!actualError) {
445-
expect(actualError).to.matchMongoSpec(expectedError);
446-
} else {
447-
const ae = Object.assign({}, actualError, { message: actualError.message });
448-
expect(ae).to.matchMongoSpec(expectedError);
449-
}
444+
expect(actualError).to.exist;
445+
expect(actualError)
446+
.property('message')
447+
.to.equal(expectedError.message);
450448
} else if (actualError) {
451449
throw actualError;
452450
}

0 commit comments

Comments
 (0)