Read/Write/Upgrade config.json with settings module
This commit is contained in:
18
test/settings_test.js
Normal file
18
test/settings_test.js
Normal file
@@ -0,0 +1,18 @@
|
||||
const should = require('should');
|
||||
const fs = require('fs');
|
||||
const settings = require('../src/common/settings');
|
||||
|
||||
const config_file_path = '../test_config.json'
|
||||
|
||||
describe('settings.js', function() {
|
||||
|
||||
it('should upgrade v0 config file', function() {
|
||||
const v0_config = {
|
||||
url: 'http://example.com/team'
|
||||
};
|
||||
config = settings.upgrade(v0_config);
|
||||
config.url.length.should.equal(1);
|
||||
config.url[0].should.equal(v0_config.url);
|
||||
config.version.should.equal(settings.version);
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user