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 var i, failingI, error
, preparedDocs = this.prepareDocumentForInsertion(newDocs) , preparedDocs = this.prepareDocumentForInsertion(newDocs)
; ;
for (i = 0; i < preparedDocs.length; i += 1) { for (i = 0; i < preparedDocs.length; i += 1) {
try { try {
this.addToIndexes(preparedDocs[i]); this.addToIndexes(preparedDocs[i]);

Binary file not shown.

@ -257,8 +257,11 @@ describe('Database', function () {
err.errorType.should.equal('uniqueViolated'); err.errorType.should.equal('uniqueViolated');
d.find({}, function (err, docs) { 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); docs.length.should.equal(0);
fs.readFileSync(testDb, 'utf8').length.should.equal(0); // Datafile not written to
done(); done();
}); });

Loading…
Cancel
Save