mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 14:17:22 +01:00
Fixed cron test
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user