-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cmap): undo flipping of
beforeHandshake
flag for timeout errors (…
- Loading branch information
Showing
4 changed files
with
83 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
'use strict'; | ||
|
||
const expect = require('chai').expect; | ||
const MongoNetworkError = require('../../lib/core/error').MongoNetworkError; | ||
|
||
describe('MongoErrors', function() { | ||
describe('MongoNetworkError', function() { | ||
it('should only define beforeHandshake symbol if boolean option passed in', function() { | ||
const errorWithOptionTrue = new MongoNetworkError('', { beforeHandshake: true }); | ||
expect(Object.getOwnPropertySymbols(errorWithOptionTrue).length).to.equal(1); | ||
|
||
const errorWithOptionFalse = new MongoNetworkError('', { beforeHandshake: false }); | ||
expect(Object.getOwnPropertySymbols(errorWithOptionFalse).length).to.equal(1); | ||
|
||
const errorWithBadOption = new MongoNetworkError('', { beforeHandshake: 'not boolean' }); | ||
expect(Object.getOwnPropertySymbols(errorWithBadOption).length).to.equal(0); | ||
|
||
const errorWithoutOption = new MongoNetworkError(''); | ||
expect(Object.getOwnPropertySymbols(errorWithoutOption).length).to.equal(0); | ||
}); | ||
}); | ||
}); |