Fixed cron test

This commit is contained in:
Keith Holliday
2016-05-11 23:40:20 -05:00
parent 5d7ebd82a4
commit 01a8fde124

View File

@@ -109,13 +109,14 @@ describe('cron middleware', () => {
it('should call next is user was not modified after cron', (done) => { it('should call next is user was not modified after cron', (done) => {
let hpBefore = user.stats.hp; let hpBefore = user.stats.hp;
user.lastCron = moment(new Date()).subtract({days: 2}); user.lastCron = moment(new Date()).subtract({days: 2});
generateDaily(user);
cronMiddleware(req, res, () => { user.save().then(function () {
expect(user.stats.hp).to.be.equal(hpBefore); cronMiddleware(req, res, function () {
expect(hpBefore).to.equal(user.stats.hp);
done(); done();
}); });
}); });
});
it('does damage for missing dailies', (done) => { it('does damage for missing dailies', (done) => {
let hpBefore = user.stats.hp; let hpBefore = user.stats.hp;