webapi-eca/testing/js/test_config.js
2014-02-10 22:28:10 +01:00

49 lines
1.3 KiB
JavaScript

// Generated by CoffeeScript 1.6.3
(function() {
var path,
_this = this;
path = require('path');
exports.setUp = function(cb) {
_this.conf = require(path.join('..', 'js-coffee', 'config'));
_this.conf({
logType: 2
});
return cb();
};
exports.testRequire = function(test) {
test.expect(1);
test.ok(_this.conf.isReady(), 'File does not exist!');
return test.done();
};
exports.testParameters = function(test) {
test.expect(4);
test.ok(_this.conf.getHttpPort(), 'HTTP port does not exist!');
test.ok(_this.conf.getDBPort(), 'DB port does not exist!');
test.ok(_this.conf.getCryptoKey(), 'Crypto key does not exist!');
test.ok(_this.conf.getSessionSecret(), 'Session Secret does not exist!');
return test.done();
};
exports.testDifferentConfigFile = function(test) {
test.expect(1);
_this.conf({
configPath: path.join('testing', 'files', 'jsonWrongConfig.json')
});
test.ok(_this.conf.isReady(), 'Different path not loaded!');
return test.done();
};
exports.testNoConfigFile = function(test) {
test.expect(1);
_this.conf({
configPath: 'wrongpath.file'
});
test.strictEqual(_this.conf.isReady(), false, 'Wrong path still loaded!');
return test.done();
};
}).call(this);