mirror of
https://github.com/ENSL/ensl_gathers.git
synced 2024-11-26 06:10:58 +00:00
Finish test for .recent
This commit is contained in:
parent
953dbded23
commit
1c0f001e4a
1 changed files with 14 additions and 12 deletions
|
@ -97,17 +97,19 @@ describe("ArchivedGather", () => {
|
|||
});
|
||||
});
|
||||
});
|
||||
// it ("returns 5 most recent gathers", done => {
|
||||
// let lastFive = gathers.slice(Math.max(gathers.length - 5, 1));
|
||||
// ArchivedGather.recent((error, results) => {
|
||||
// if (error) return done(error);
|
||||
// assert.equal(results.length, 5);
|
||||
// lastFive.forEach(recent => {
|
||||
// assert.isTrue(results.some(result => {
|
||||
// return result.gather.done.time === recent.done.time;
|
||||
// }));
|
||||
// });
|
||||
// });
|
||||
// });
|
||||
it ("returns 5 most recent gathers", done => {
|
||||
let lastFive = gathers.slice(Math.max(gathers.length - 5, 1));
|
||||
ArchivedGather.recent((error, results) => {
|
||||
if (error) return done(error);
|
||||
assert.equal(results.length, 5);
|
||||
lastFive.forEach(recent => {
|
||||
assert.isTrue(results.some(result => {
|
||||
return result.gather.done.time.getTime()
|
||||
=== recent.gather.done.time.getTime();
|
||||
}));
|
||||
});
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Reference in a new issue