Changes to have settings tests pass. test/specs/settings_test.js
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
const settings = require('../../src/common/settings');
|
||||
const deepmerge = require('deepmerge');
|
||||
|
||||
describe('common/settings.js', () => {
|
||||
it('should upgrade v0 config file', () => {
|
||||
@@ -10,4 +11,14 @@ describe('common/settings.js', () => {
|
||||
config.teams[0].url.should.equal(v0Config.url);
|
||||
config.version.should.equal(settings.version);
|
||||
});
|
||||
|
||||
it('should loadDefault config for version 1', () => {
|
||||
const baseConfig = require('../../src/common/config/base.json');
|
||||
const overrideConfig = require('../../src/common/config/override.json');
|
||||
const expectedDefaults = deepmerge(
|
||||
baseConfig[1], overrideConfig[1] || {}, {clone: true, arrayMerge: settings.deepMergeArray}
|
||||
);
|
||||
const defaultConfig = settings.loadDefault();
|
||||
defaultConfig.should.eql(expectedDefaults);
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user