Fixed failing test

pull/2/head
Louis Chatriot 10 years ago
parent 3abfa53b06
commit d65e89fb82
  1. 2
      lib/datastore.js
  2. BIN
      test/.db.test.js.swo
  3. 5
      test/db.test.js

@ -341,7 +341,7 @@ Datastore.prototype._insertMultipleDocsInCache = function (newDocs) {
var i, failingI, error
, preparedDocs = this.prepareDocumentForInsertion(newDocs)
;
for (i = 0; i < preparedDocs.length; i += 1) {
try {
this.addToIndexes(preparedDocs[i]);

Binary file not shown.

@ -257,8 +257,11 @@ describe('Database', function () {
err.errorType.should.equal('uniqueViolated');
d.find({}, function (err, docs) {
// Datafile only contains index definition
var datafileContents = model.deserialize(fs.readFileSync(testDb, 'utf8'));
assert.deepEqual(datafileContents, { $$indexCreated: { fieldName: 'a', unique: true } });
docs.length.should.equal(0);
fs.readFileSync(testDb, 'utf8').length.should.equal(0); // Datafile not written to
done();
});

Loading…
Cancel
Save