Read/Write/Upgrade config.json with settings module

This commit is contained in:
Yuya Ochiai
2015-12-13 22:57:31 +09:00
parent 8cdb34f340
commit dc9794b1f5
5 changed files with 90 additions and 10 deletions

18
test/settings_test.js Normal file
View 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);
});
});