tests(api): Add async to every it, before and beforeEach in v2 tests

This commit is contained in:
Blade Barringer
2016-01-01 10:32:28 -06:00
parent 23aaf78167
commit 69c5192f70
28 changed files with 186 additions and 186 deletions

View File

@@ -6,14 +6,14 @@ import {
describe('GET /user/tasks/:id', () => {
let user, task;
beforeEach(() => {
beforeEach(async () => {
return generateUser().then((_user) => {
user = _user;
task = user.todos[0];
});
});
it('gets a task', () => {
it('gets a task', async () => {
return user.get(`/user/tasks/${task.id}`).then((foundTask) => {
expect(foundTask.id).to.eql(task.id);
expect(foundTask.text).to.eql(task.text);
@@ -23,7 +23,7 @@ describe('GET /user/tasks/:id', () => {
});
});
it('returns an error if the task does not exist', () => {
it('returns an error if the task does not exist', async () => {
return expect(user.get('/user/tasks/task-that-does-not-exist'))
.to.eventually.be.rejected.and.eql({
code: 404,
@@ -31,7 +31,7 @@ describe('GET /user/tasks/:id', () => {
});
});
it('does not get another user\'s task', () => {
it('does not get another user\'s task', async () => {
return expect(generateUser().then((otherUser) => {
let otherUsersTask = otherUser.todos[0];