Skip to content

Commit

Permalink
Make sure done() is called from before hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
jaswilli committed Jun 10, 2015
1 parent 9e5d9e9 commit 6c9682c
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 45 deletions.
16 changes: 4 additions & 12 deletions core/test/functional/module/module_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ describe('Module', function () {
should.exist(ghostServer);

done();
}).catch(function (e) {
done(e);
});
}).catch(done);
});

it('should expose an express instance', function (done) {
Expand All @@ -24,9 +22,7 @@ describe('Module', function () {
should.exist(ghostServer.rootApp);

done();
}).catch(function (e) {
done(e);
});
}).catch(done);
});

it('should expose configuration values', function (done) {
Expand All @@ -39,9 +35,7 @@ describe('Module', function () {
should.equal(ghostServer.config.paths.subdir, '');

done();
}).catch(function (e) {
done(e);
});
}).catch(done);
});

it('should have start/stop/restart functions', function (done) {
Expand All @@ -52,9 +46,7 @@ describe('Module', function () {
ghostServer.stop.should.be.a.Function;

done();
}).catch(function (e) {
done(e);
});
}).catch(done);
});
});
});
5 changes: 1 addition & 4 deletions core/test/functional/routes/api/authentication_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ describe('Authentication API', function () {
}).then(function (token) {
accesstoken = token;
done();
}).catch(function (e) {
console.log('Ghost Error: ', e);
console.log(e.stack);
});
}).catch(done);
});

after(function (done) {
Expand Down
5 changes: 1 addition & 4 deletions core/test/functional/routes/api/db_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ describe('DB API', function () {
}).then(function (token) {
accesstoken = token;
done();
}).catch(function (e) {
console.log('Ghost Error: ', e);
console.log(e.stack);
});
}).catch(done);
});

after(function (done) {
Expand Down
2 changes: 1 addition & 1 deletion core/test/functional/routes/api/error_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('Unauthorized', function () {
request = supertest.agent(ghostServer.rootApp);

done();
});
}).catch(done);
});

after(function (done) {
Expand Down
5 changes: 1 addition & 4 deletions core/test/functional/routes/api/notifications_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ describe('Notifications API', function () {
}).then(function (token) {
accesstoken = token;
done();
}).catch(function (e) {
console.log('Ghost Error: ', e);
console.log(e.stack);
});
}).catch(done);
});

after(function (done) {
Expand Down
5 changes: 1 addition & 4 deletions core/test/functional/routes/api/posts_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ describe('Post API', function () {
}).then(function (token) {
accesstoken = token;
done();
}).catch(function (e) {
console.log('Ghost Error: ', e);
console.log(e.stack);
});
}).catch(done);
});

after(function (done) {
Expand Down
5 changes: 1 addition & 4 deletions core/test/functional/routes/api/settings_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ describe('Settings API', function () {
}).then(function (token) {
accesstoken = token;
done();
}).catch(function (e) {
console.log('Ghost Error: ', e);
console.log(e.stack);
});
}).catch(done);
});

after(function (done) {
Expand Down
5 changes: 1 addition & 4 deletions core/test/functional/routes/api/slugs_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ describe('Slug API', function () {
}).then(function (token) {
accesstoken = token;
done();
}).catch(function (e) {
console.log('Ghost Error: ', e);
console.log(e.stack);
});
}).catch(done);
});

after(function (done) {
Expand Down
5 changes: 1 addition & 4 deletions core/test/functional/routes/api/tags_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ describe('Tag API', function () {
}).then(function (token) {
accesstoken = token;
done();
}).catch(function (e) {
console.log('Ghost Error: ', e);
console.log(e.stack);
});
}).catch(done);
});

after(function (done) {
Expand Down
5 changes: 1 addition & 4 deletions core/test/functional/routes/api/users_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ describe('User API', function () {
}).then(function (token) {
accesstoken = token;
done();
}).catch(function (e) {
console.log('Ghost Error: ', e);
console.log(e.stack);
});
}).catch(done);
});

after(function (done) {
Expand Down

0 comments on commit 6c9682c

Please sign in to comment.