mirror of
https://github.com/Hopiu/webapi-eca.git
synced 2026-03-17 06:20:23 +00:00
63 lines
1.8 KiB
JavaScript
63 lines
1.8 KiB
JavaScript
// Generated by CoffeeScript 1.6.3
|
|
(function() {
|
|
var path,
|
|
_this = this;
|
|
|
|
path = require('path');
|
|
|
|
exports.setUp = function(cb) {
|
|
var log, logger;
|
|
logger = require(path.join('..', 'js-coffee', 'logging'));
|
|
log = logger.getLogger({
|
|
nolog: true
|
|
});
|
|
_this.conf = require(path.join('..', 'js-coffee', 'config'));
|
|
_this.conf({
|
|
logger: log
|
|
});
|
|
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) {
|
|
var logconf, prop, reqProp, _i, _len;
|
|
reqProp = ['mode', 'io-level', 'file-level', 'file-path'];
|
|
test.expect(4 + reqProp.length);
|
|
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!');
|
|
logconf = _this.conf.getLogConf();
|
|
test.ok(logconf, 'Log config does not exist!');
|
|
for (_i = 0, _len = reqProp.length; _i < _len; _i++) {
|
|
prop = reqProp[_i];
|
|
test.ok(logconf[prop], "Log conf property " + prop + " does not exist!");
|
|
}
|
|
return test.done();
|
|
};
|
|
|
|
exports.testDifferentConfigFile = function(test) {
|
|
test.expect(1);
|
|
_this.conf({
|
|
nolog: true,
|
|
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({
|
|
nolog: true,
|
|
configPath: 'wrongpath.file'
|
|
});
|
|
test.strictEqual(_this.conf.isReady(), false, 'Wrong path still loaded!');
|
|
return test.done();
|
|
};
|
|
|
|
}).call(this);
|