Ghost/core/test/functional/module/module_spec.js
kirrg001 0ae0a0b490 🎨 change how we get and set config
refs #6982
- a replace for all config usages
- always use config.get or config.set
- this a pure replacement, no logic has changed

[ci skip]
2016-09-20 15:59:34 +01:00

50 lines
1.6 KiB
JavaScript

// # Module tests
// This tests using Ghost as an npm module
var should = require('should'),
ghost = require('../../../../core'),
i18n = require('../../../../core/server/i18n');
i18n.init();
describe('Module', function () {
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);
});
});
});