webapi-eca/testing/test_config.js
2014-02-04 08:35:07 +01:00

46 lines
1.2 KiB
JavaScript

// Generated by CoffeeScript 1.6.3
(function() {
var _this = this;
exports.setUp = function(cb) {
_this.conf = require('../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: 'testing/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);