Socket
Socket
Sign inDemoInstall

bson

Package Overview
Dependencies
Maintainers
2
Versions
162
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bson - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

test/node/to_bson_test.js

2

package.json
{ "name" : "bson"
, "description" : "A bson parser for node.js and the browser"
, "keywords" : ["mongodb", "bson", "parser"]
, "version" : "0.0.5"
, "version" : "0.0.6"
, "author" : "Christian Amor Kvalheim <christkv@gmail.com>"

@@ -6,0 +6,0 @@ , "contributors" : []

@@ -160,3 +160,21 @@ this.bson_test = {

test.done();
}
},
'Should correctly handle toBson function for an object': function(test) {
// Test object
var doc = {
hello: new ObjectID(),
a:1
};
// Add a toBson method to the object
doc.toBSON = function() {
return {b:1};
}
// Serialize the data
var serialized_data = BSON.serialize(doc, false, true);
var deserialized_doc = BSON.deserialize(serialized_data);
test.equal(1, deserialized_doc.b);
test.done();
}
};

@@ -163,0 +181,0 @@

@@ -19,2 +19,3 @@ var sys = require('util'),

Timestamp = require('../../lib/bson/bson').Timestamp,
gleak = require('../../tools/gleak'),
assert = require('assert');

@@ -460,2 +461,11 @@

test.done();
}
/**
* @ignore
*/
exports.noGlobalsLeaked = function(test) {
var leaks = gleak.detectNew();
test.equal(0, leaks.length, "global var leak detected: " + leaks.join(', '));
test.done();
}

@@ -18,2 +18,3 @@ var sys = require('util'),

Timestamp = require('../../lib/bson/bson').Timestamp,
gleak = require('../../tools/gleak'),
assert = require('assert');

@@ -252,3 +253,3 @@

var keys = []
for(name in decoded_hash) keys.push(name)
for(var name in decoded_hash) keys.push(name)
assert.deepEqual(['b', 'a', 'c', 'd'], keys)

@@ -298,1 +299,10 @@ test.done();

}
/**
* @ignore
*/
exports.noGlobalsLeaked = function(test) {
var leaks = gleak.detectNew();
test.equal(0, leaks.length, "global var leak detected: " + leaks.join(', '));
test.done();
}

@@ -8,3 +8,4 @@

gleak.ignore('Uint8ClampedArray');
gleak.ignore('TAP_Global_Harness');
module.exports = gleak;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc