|
|
@@ -13,21 +13,21 @@ describe('Test for Crowi application context', function() {
|
|
|
|
|
|
describe('construction', function() {
|
|
|
it('initialize crowi context', function() {
|
|
|
- const crowi = new Crowi(helpers.root(), process.env);
|
|
|
+ const crowi = new Crowi(helpers.root());
|
|
|
expect(crowi).to.be.instanceof(Crowi);
|
|
|
expect(crowi.version).to.equal(require('../../../package.json').version);
|
|
|
expect(crowi.env).to.be.an('Object');
|
|
|
});
|
|
|
|
|
|
it('config getter, setter', function() {
|
|
|
- const crowi = new Crowi(helpers.root(), process.env);
|
|
|
+ const crowi = new Crowi(helpers.root());
|
|
|
expect(crowi.getConfig()).to.deep.equals({});
|
|
|
crowi.setConfig({test: 1});
|
|
|
expect(crowi.getConfig()).to.deep.equals({test: 1});
|
|
|
});
|
|
|
|
|
|
it('model getter, setter', function() {
|
|
|
- const crowi = new Crowi(helpers.root(), process.env);
|
|
|
+ const crowi = new Crowi(helpers.root());
|
|
|
// set
|
|
|
crowi.model('hoge', { fuga: 1 });
|
|
|
expect(crowi.model('hoge')).to.deep.equals({ fuga: 1 });
|
|
|
@@ -39,9 +39,9 @@ describe('Test for Crowi application context', function() {
|
|
|
mongoose.disconnect(); // avoid error of Trying to open unclosed connection
|
|
|
});
|
|
|
it('setup completed', function(done) {
|
|
|
- const crowi = new Crowi(helpers.root(), process.env);
|
|
|
+ const crowi = new Crowi(helpers.root());
|
|
|
// set
|
|
|
- const p = crowi.setupDatabase()
|
|
|
+ const p = crowi.setupDatabase();
|
|
|
expect(p).to.instanceof(Promise);
|
|
|
p.then(function() {
|
|
|
expect(mongoose.connection.readyState).to.equals(1);
|