Skip to content
This repository
Browse code

failing test; addToSet with dup dates

  • Loading branch information...
commit 47620fc3665e0982960dbe920ea101759668e485 1 parent aacfeac
Aaron Heckmann aheckmann authored

Showing 1 changed file with 15 additions and 0 deletions. Show diff stats Hide diff stats

  1. +15 0 test/types.array.test.js
15 test/types.array.test.js
@@ -249,11 +249,13 @@ module.exports = {
249 249 var d1 = new Date;
250 250 var d2 = new Date( d1 + 60000);
251 251 var d3 = new Date( d1 + 30000);
  252 + var d4 = new Date( d1 + 20000);
252 253 m.date.push(d1, d2);
253 254
254 255 var id1 = new mongoose.Types.ObjectId;
255 256 var id2 = new mongoose.Types.ObjectId;
256 257 var id3 = new mongoose.Types.ObjectId;
  258 + var id4 = new mongoose.Types.ObjectId;
257 259
258 260 m.id.push(id1, id2);
259 261
@@ -306,6 +308,19 @@ module.exports = {
306 308 m.doc.some(function(v){return v.name === 'Waltz'}).should.be.ok
307 309 m.doc.some(function(v){return v.name === 'Dubstep'}).should.be.ok
308 310 m.doc.some(function(v){return v.name === 'Polka'}).should.be.ok
  311 +
  312 + //
  313 + m.num.addToSet(3,4,5,6);
  314 + m.num.length.should.equal(6);
  315 + m.str.$addToSet('four', 'five', 'two', 'six');
  316 + m.str.length.should.equal(6);
  317 + m.id.addToSet(id2, id3, id4);
  318 + m.id.length.should.equal(4);
  319 + m.doc.$addToSet(m.doc[0], { name: '8bit' });
  320 + m.doc.length.should.equal(4);
  321 + m.date.$addToSet(d1, d3, d4);
  322 + m.date.length.should.equal(3);
  323 +
309 324 });
310 325 });
311 326 }

0 comments on commit 47620fc

Please sign in to comment.
Something went wrong with that request. Please try again.