Skip to content

Commit

Permalink
* Add additional error checks.g
Browse files Browse the repository at this point in the history
  • Loading branch information
kcbanner committed Sep 9, 2012
1 parent 3a14985 commit 28298d0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/connect-mongo.test.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -345,7 +345,9 @@ exports.test_get_with_raw_db = function(done) {
var sid = 'test_get-sid'; var sid = 'test_get-sid';
collection.insert({_id: sid, session: JSON.stringify({key1: 1, key2: 'two'})}, function(error, ids) { collection.insert({_id: sid, session: JSON.stringify({key1: 1, key2: 'two'})}, function(error, ids) {
store.get(sid, function(err, session) { store.get(sid, function(err, session) {
assert.deepEqual(session, {key1: 1, key2: 'two'}); assert.strictEqual(err, null);
assert.deepEqual(session, {key1: 1, key2: 'two'});

cleanup(store, db, collection, function() { cleanup(store, db, collection, function() {
done(); done();
}); });
Expand All @@ -361,6 +363,7 @@ exports.test_length_with_raw_db = function(done) {
store.length(function(err, length) { store.length(function(err, length) {
assert.strictEqual(err, null); assert.strictEqual(err, null);
assert.strictEqual(length, 1); assert.strictEqual(length, 1);

cleanup(store, db, collection, function() { cleanup(store, db, collection, function() {
done(); done();
}); });
Expand All @@ -375,6 +378,7 @@ exports.test_destroy_ok_with_raw_db = function(done) {
collection.insert({_id: sid, session: JSON.stringify({key1: 1, key2: 'two'})}, function(error, ids) { collection.insert({_id: sid, session: JSON.stringify({key1: 1, key2: 'two'})}, function(error, ids) {
store.destroy(sid, function(err) { store.destroy(sid, function(err) {
assert.strictEqual(err, undefined); assert.strictEqual(err, undefined);

cleanup(store, db, collection, function() { cleanup(store, db, collection, function() {
done(); done();
}); });
Expand All @@ -389,6 +393,7 @@ exports.test_clear_with_raw_db = function(done) {
collection.insert({_id: sid, key1: 1, key2: 'two'}, function(error, ids) { collection.insert({_id: sid, key1: 1, key2: 'two'}, function(error, ids) {
store.clear(function(err) { store.clear(function(err) {
collection.count(function(err, count) { collection.count(function(err, count) {
assert.strictEqual(err, null);
assert.strictEqual(count, 0); assert.strictEqual(count, 0);


cleanup(store, db, collection, function() { cleanup(store, db, collection, function() {
Expand Down

0 comments on commit 28298d0

Please sign in to comment.