make ordering of results predictable

This commit is contained in:
Girish Ramakrishnan
2016-11-19 18:24:32 +05:30
parent 94037e5266
commit 1adc47ab32

View File

@@ -1179,6 +1179,7 @@ describe('database', function () {
eventlogdb.getAllPaged(null, null, 1, 100, function (error, results) {
expect(error).to.be(null);
expect(results.length).to.be(2);
results = results.sort(function (x, y) { return x.action > y.action }); // because equal timestamp gives random ordering
expect(results[1].action).to.be.eql('persistent.event');
expect(results[0].action).to.be.eql('anotherpersistent.event');