mirror of https://github.com/pelias/api.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
750 B
36 lines
750 B
8 years ago
|
'use strict';
|
||
|
|
||
|
const proxyquire = require('proxyquire').noCallThru();
|
||
|
|
||
|
module.exports.tests = {};
|
||
|
|
||
|
module.exports.tests.invalid_configuration = function(test, common) {
|
||
|
test('configuration validation throwing error should rethrow', function(t) {
|
||
|
t.throws(function() {
|
||
|
proxyquire('../../app', {
|
||
|
'./src/configValidation': {
|
||
|
validate: () => {
|
||
|
throw Error('config is not valid');
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
|
||
|
}, /config is not valid/);
|
||
|
|
||
|
t.end();
|
||
|
|
||
|
});
|
||
|
|
||
|
};
|
||
|
|
||
|
module.exports.all = function (tape, common) {
|
||
|
|
||
|
function test(name, testFunction) {
|
||
|
return tape('app: ' + name, testFunction);
|
||
|
}
|
||
|
|
||
|
for( var testCase in module.exports.tests ){
|
||
|
module.exports.tests[testCase](test, common);
|
||
|
}
|
||
|
};
|