Skip to content
This repository has been archived by the owner on Dec 17, 2018. It is now read-only.

Commit

Permalink
Order of removed instances shouldn't matter.
Browse files Browse the repository at this point in the history
There's no way to control the order in which RethinkDB returns multiple deleted items.  This changes the delete many test to check for the presence of the names in the array.  I've tested this to work with feathers-mongoose, feathers-rethinkdb, and feathers-sequelize.
  • Loading branch information
marshallswain committed Apr 1, 2016
1 parent bd44d7f commit 63b150d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/common-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ export default function common(people, _ids, errors, idProp = 'id') {
return people.remove(null, { query: { created: true } });
}).then(data => {
expect(data.length).to.equal(2);
expect(data[0].name).to.equal('Dave');
expect(data[1].name).to.equal('David');
let names = data.filter(person => person.name);
expect(names.indexOf('Dave')).to.be.greater.than(-1);
expect(names.indexOf('David')).to.be.greater.than(-1);
done();
}).catch(done);
});
Expand Down

0 comments on commit 63b150d

Please sign in to comment.