Merge pull request #5416 from jaswilli/fixup-test

Make sure done() is called from before hooks
This commit is contained in:
Hannah Wolfe 2015-06-10 09:19:50 +01:00
commit 9071d7a749
10 changed files with 13 additions and 45 deletions

View File

@ -13,9 +13,7 @@ describe('Module', function () {
should.exist(ghostServer); should.exist(ghostServer);
done(); done();
}).catch(function (e) { }).catch(done);
done(e);
});
}); });
it('should expose an express instance', function (done) { it('should expose an express instance', function (done) {
@ -24,9 +22,7 @@ describe('Module', function () {
should.exist(ghostServer.rootApp); should.exist(ghostServer.rootApp);
done(); done();
}).catch(function (e) { }).catch(done);
done(e);
});
}); });
it('should expose configuration values', function (done) { it('should expose configuration values', function (done) {
@ -39,9 +35,7 @@ describe('Module', function () {
should.equal(ghostServer.config.paths.subdir, ''); should.equal(ghostServer.config.paths.subdir, '');
done(); done();
}).catch(function (e) { }).catch(done);
done(e);
});
}); });
it('should have start/stop/restart functions', function (done) { it('should have start/stop/restart functions', function (done) {
@ -52,9 +46,7 @@ describe('Module', function () {
ghostServer.stop.should.be.a.Function; ghostServer.stop.should.be.a.Function;
done(); done();
}).catch(function (e) { }).catch(done);
done(e);
});
}); });
}); });
}); });

View File

@ -20,10 +20,7 @@ describe('Authentication API', function () {
}).then(function (token) { }).then(function (token) {
accesstoken = token; accesstoken = token;
done(); done();
}).catch(function (e) { }).catch(done);
console.log('Ghost Error: ', e);
console.log(e.stack);
});
}); });
after(function (done) { after(function (done) {

View File

@ -19,10 +19,7 @@ describe('DB API', function () {
}).then(function (token) { }).then(function (token) {
accesstoken = token; accesstoken = token;
done(); done();
}).catch(function (e) { }).catch(done);
console.log('Ghost Error: ', e);
console.log(e.stack);
});
}); });
after(function (done) { after(function (done) {

View File

@ -18,7 +18,7 @@ describe('Unauthorized', function () {
request = supertest.agent(ghostServer.rootApp); request = supertest.agent(ghostServer.rootApp);
done(); done();
}); }).catch(done);
}); });
after(function (done) { after(function (done) {

View File

@ -20,10 +20,7 @@ describe('Notifications API', function () {
}).then(function (token) { }).then(function (token) {
accesstoken = token; accesstoken = token;
done(); done();
}).catch(function (e) { }).catch(done);
console.log('Ghost Error: ', e);
console.log(e.stack);
});
}); });
after(function (done) { after(function (done) {

View File

@ -22,10 +22,7 @@ describe('Post API', function () {
}).then(function (token) { }).then(function (token) {
accesstoken = token; accesstoken = token;
done(); done();
}).catch(function (e) { }).catch(done);
console.log('Ghost Error: ', e);
console.log(e.stack);
});
}); });
after(function (done) { after(function (done) {

View File

@ -21,10 +21,7 @@ describe('Settings API', function () {
}).then(function (token) { }).then(function (token) {
accesstoken = token; accesstoken = token;
done(); done();
}).catch(function (e) { }).catch(done);
console.log('Ghost Error: ', e);
console.log(e.stack);
});
}); });
after(function (done) { after(function (done) {

View File

@ -21,10 +21,7 @@ describe('Slug API', function () {
}).then(function (token) { }).then(function (token) {
accesstoken = token; accesstoken = token;
done(); done();
}).catch(function (e) { }).catch(done);
console.log('Ghost Error: ', e);
console.log(e.stack);
});
}); });
after(function (done) { after(function (done) {

View File

@ -21,10 +21,7 @@ describe('Tag API', function () {
}).then(function (token) { }).then(function (token) {
accesstoken = token; accesstoken = token;
done(); done();
}).catch(function (e) { }).catch(done);
console.log('Ghost Error: ', e);
console.log(e.stack);
});
}); });
after(function (done) { after(function (done) {

View File

@ -21,10 +21,7 @@ describe('User API', function () {
}).then(function (token) { }).then(function (token) {
accesstoken = token; accesstoken = token;
done(); done();
}).catch(function (e) { }).catch(done);
console.log('Ghost Error: ', e);
console.log(e.stack);
});
}); });
after(function (done) { after(function (done) {