diff --git a/test/integration/api/db/geotag.js b/test/integration/api/db/geotag.js index 3a6bdbd8..7eb4664e 100644 --- a/test/integration/api/db/geotag.js +++ b/test/integration/api/db/geotag.js @@ -45,13 +45,13 @@ describe('Geotag', () => { } }); - after(() => { + after(async () => { for (let post of posts) { - post.destroy(); + await post.destroy(); } for (let geotag of geotags) { - geotag.destroy(); + await geotag.destroy(); } }); @@ -103,4 +103,4 @@ describe('Geotag', () => { expect(geotag.get('updated_at'), 'to equal', dates[1]); }); }); -}); \ No newline at end of file +}); diff --git a/test/integration/api/db/hashtag.js b/test/integration/api/db/hashtag.js index 064e0e6e..f05d53f7 100644 --- a/test/integration/api/db/hashtag.js +++ b/test/integration/api/db/hashtag.js @@ -45,13 +45,13 @@ describe('Hashtag', () => { } }); - after(() => { + after(async () => { for (let post of posts) { - post.destroy(); + await post.destroy(); } for (let hashtag of hashtags) { - hashtag.destroy(); + await hashtag.destroy(); } }); @@ -103,4 +103,4 @@ describe('Hashtag', () => { expect(hashtag.get('updated_at'), 'to equal', dates[1]); }); }); -}); \ No newline at end of file +}); diff --git a/test/integration/api/db/post.js b/test/integration/api/db/post.js index 05dbc3e7..8be76e15 100644 --- a/test/integration/api/db/post.js +++ b/test/integration/api/db/post.js @@ -39,9 +39,9 @@ describe('Post', () => { school = await new School(SchoolFactory.build({updated_at: null})).save(null, {method: 'insert'}); }); - after(() => { - post.destroy(); - school.destroy(); + after(async () => { + await post.destroy(); + await school.destroy(); }); it('attachSchool updates school updated_at field', async () => { @@ -66,9 +66,9 @@ describe('Post', () => { } }); - after(() => { + after(async () => { for (let geotag of geotags) { - geotag.destroy(); + await geotag.destroy(); } }); @@ -122,7 +122,7 @@ describe('Post', () => { await newGeotag.refresh(); expect(newGeotag.get('post_count'), 'to equal', 1); - newGeotag.destroy(); + await newGeotag.destroy(); }); }); }); @@ -140,9 +140,9 @@ describe('Post', () => { } }); - after(() => { + after(async () => { for (let school of schools) { - school.destroy(); + await school.destroy(); } }); @@ -196,7 +196,7 @@ describe('Post', () => { await newSchool.refresh(); expect(newSchool.get('post_count'), 'to equal', 1); - newSchool.destroy(); + await newSchool.destroy(); }); }); }); @@ -214,9 +214,9 @@ describe('Post', () => { } }); - after(() => { + after(async () => { for (let hashtag of hashtags) { - hashtag.destroy(); + await hashtag.destroy(); } }); @@ -270,8 +270,8 @@ describe('Post', () => { await newHashtag.refresh(); expect(newHashtag.get('post_count'), 'to equal', 1); - newHashtag.destroy(); + await newHashtag.destroy(); }); }); }); -}); \ No newline at end of file +}); diff --git a/test/integration/api/db/school.js b/test/integration/api/db/school.js index df3a051b..87784636 100644 --- a/test/integration/api/db/school.js +++ b/test/integration/api/db/school.js @@ -45,13 +45,13 @@ describe('School', () => { } }); - after(() => { + after(async () => { for (let post of posts) { - post.destroy(); + await post.destroy(); } for (let school of schools) { - school.destroy(); + await school.destroy(); } }); @@ -103,4 +103,4 @@ describe('School', () => { expect(school.get('updated_at'), 'to equal', dates[1]); }); }); -}); \ No newline at end of file +}); diff --git a/test/integration/api/post.js b/test/integration/api/post.js index 60ff4605..db77d359 100644 --- a/test/integration/api/post.js +++ b/test/integration/api/post.js @@ -180,8 +180,8 @@ describe('Post', () => { }); after(async () => { - user.destroy(); - post.destroy(); + await user.destroy(); + await post.destroy(); }); afterEach(async () => { diff --git a/test/integration/api/school.js b/test/integration/api/school.js index 311e596c..01869868 100644 --- a/test/integration/api/school.js +++ b/test/integration/api/school.js @@ -36,9 +36,9 @@ describe('Post', () => { } }); - after(() => { + after(async () => { for (const school of schools) { - school.destroy(); + await school.destroy(); } }); diff --git a/test/integration/auth.js b/test/integration/auth.js index 0e5befad..5da42515 100644 --- a/test/integration/auth.js +++ b/test/integration/auth.js @@ -385,7 +385,7 @@ describe('api v1', async () => { }); after(async () => { - otherPost.destroy(); + await otherPost.destroy(); }); describe('Posts', async () => {