From 63b150d5aee22ee0f1a62fd041182e4ac678785b Mon Sep 17 00:00:00 2001 From: Marshall Thompson Date: Thu, 31 Mar 2016 20:46:44 -0600 Subject: [PATCH] Order of removed instances shouldn't matter. 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. --- src/common-tests.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/common-tests.js b/src/common-tests.js index a9f05ba..cde7bcf 100644 --- a/src/common-tests.js +++ b/src/common-tests.js @@ -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); });