mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
47e00900cc
no issue - change out should.equal for // jshint ignore:line - ensure should is the first require in every test, and ALWAYS require - make sinon the second require, and sandbox the last thing - ALWAYS use sandbox, futureproofs tests against contributors who don't know it - change require formatting
52 lines
1.6 KiB
JavaScript
52 lines
1.6 KiB
JavaScript
// # Module tests
|
|
// This tests using Ghost as an npm module
|
|
var should = require('should'),
|
|
testUtils = require('../../utils'),
|
|
ghost = testUtils.startGhost,
|
|
i18n = require('../../../../core/server/i18n');
|
|
|
|
i18n.init();
|
|
|
|
describe('Module', function () {
|
|
before(testUtils.teardown);
|
|
|
|
describe('Setup', function () {
|
|
it('should resolve with a ghost-server instance', function (done) {
|
|
ghost().then(function (ghostServer) {
|
|
should.exist(ghostServer);
|
|
|
|
done();
|
|
}).catch(done);
|
|
});
|
|
|
|
it('should expose an express instance', function (done) {
|
|
ghost().then(function (ghostServer) {
|
|
should.exist(ghostServer);
|
|
should.exist(ghostServer.rootApp);
|
|
|
|
done();
|
|
}).catch(done);
|
|
});
|
|
|
|
it('should expose configuration values', function (done) {
|
|
ghost().then(function (ghostServer) {
|
|
should.exist(ghostServer);
|
|
should.exist(ghostServer.config);
|
|
should.exist(ghostServer.config.get('server'));
|
|
should.exist(ghostServer.config.get('paths'));
|
|
done();
|
|
}).catch(done);
|
|
});
|
|
|
|
it('should have start/stop/restart functions', function (done) {
|
|
ghost().then(function (ghostServer) {
|
|
should.exist(ghostServer);
|
|
ghostServer.start.should.be.a.Function();
|
|
ghostServer.restart.should.be.a.Function();
|
|
ghostServer.stop.should.be.a.Function();
|
|
|
|
done();
|
|
}).catch(done);
|
|
});
|
|
});
|
|
});
|