We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 931c59f commit 6de6fdbCopy full SHA for 6de6fdb
test/node/to_bson_test.js
@@ -183,6 +183,15 @@ describe('toBSON', function () {
183
const sizeNestedToBSON = BSON.calculateObjectSize({ a: [0] });
184
expect(sizeNestedToBSON).to.equal(33);
185
});
186
+
187
+ it('uses toBSON on elements of a Map', () => {
188
+ const map = new Map();
189
+ map.set('a', 100);
190
191
+ const serializedData = BSON.serialize(map);
192
+ const deserializedData = BSON.deserialize(serializedData);
193
+ expect(deserializedData).to.have.property('a', 'hello number');
194
+ });
195
196
197
it('should use toBSON in calculateObjectSize', () => {
0 commit comments