Comparing version 0.0.5 to 0.0.6
{ "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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43
11456
575438
14