mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 06:37:23 +01:00
fixed recoverCron tests failure when using mocha v3+ (#8407)
* fixed recoverCron tests * type'o fix * grammar nazi fix * lint fix * reverted to async/await (but done call removed) * fixed Tasks tests failure on Mocha 3+
This commit is contained in:
committed by
Matteo Pagliazzi
parent
42c5e6c22b
commit
86d65956d9
@@ -91,25 +91,23 @@ describe('Task Model', () => {
|
||||
sandbox.spy(Tasks.Task, 'findOne');
|
||||
});
|
||||
|
||||
it('throws an error if task identifier is not passed in', async (done) => {
|
||||
it('throws an error if task identifier is not passed in', async () => {
|
||||
try {
|
||||
await Tasks.Task.findByIdOrAlias(null, user._id);
|
||||
throw new Error('No exception when Id is None');
|
||||
} catch (err) {
|
||||
expect(err).to.exist;
|
||||
expect(err).to.eql(new InternalServerError('Task identifier is a required argument'));
|
||||
|
||||
done();
|
||||
}
|
||||
});
|
||||
|
||||
it('throws an error if user identifier is not passed in', async (done) => {
|
||||
it('throws an error if user identifier is not passed in', async () => {
|
||||
try {
|
||||
await Tasks.Task.findByIdOrAlias(taskWithAlias._id);
|
||||
throw new Error('No exception when user_id is undefined');
|
||||
} catch (err) {
|
||||
expect(err).to.exist;
|
||||
expect(err).to.eql(new InternalServerError('User identifier is a required argument'));
|
||||
|
||||
done();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user