mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
tests(api): Add async to every it, before and beforeEach in v2 tests
This commit is contained in:
@@ -8,14 +8,14 @@ import { each } from 'lodash';
|
||||
describe('POST /user/batch-update', () => {
|
||||
let user;
|
||||
|
||||
beforeEach(() => {
|
||||
beforeEach(async () => {
|
||||
return generateUser().then((usr) => {
|
||||
user = usr;
|
||||
});
|
||||
});
|
||||
|
||||
context('allowed operations', () => {
|
||||
it('makes batch operations', () => {
|
||||
it('makes batch operations', async () => {
|
||||
let task;
|
||||
|
||||
return user.get('/user/tasks').then((tasks) => {
|
||||
@@ -45,7 +45,7 @@ describe('POST /user/batch-update', () => {
|
||||
|
||||
each(protectedOperations, (operation, description) => {
|
||||
|
||||
it(`it sends back a 500 error for ${description} operation`, () => {
|
||||
it(`it sends back a 500 error for ${description} operation`, async () => {
|
||||
return expect(user.post('/user/batch-update', [
|
||||
{ op: operation },
|
||||
])).to.eventually.be.rejected.and.eql({
|
||||
@@ -57,7 +57,7 @@ describe('POST /user/batch-update', () => {
|
||||
});
|
||||
|
||||
context('unknown operations', () => {
|
||||
it('sends back a 500 error', () => {
|
||||
it('sends back a 500 error', async () => {
|
||||
return expect(user.post('/user/batch-update', [
|
||||
{op: 'aNotRealOperation'},
|
||||
])).to.eventually.be.rejected.and.eql({
|
||||
|
||||
Reference in New Issue
Block a user