mirror of https://github.com/pelias/api.git
Browse Source
test/unit/config/queryAdminWeights.js
-Add a test for the file introduced in b6f0c1c
.
-Verify that its configuration values are valid.
search-all-admins
Severyn Kozak
10 years ago
2 changed files with 32 additions and 2 deletions
@ -0,0 +1,29 @@
|
||||
/** |
||||
* Tests for the `config/queryAdminWeights` configuration file. |
||||
*/ |
||||
|
||||
var queryAdminWeights = require( '../../../config/queryAdminWeights' ); |
||||
var isObject = require( 'is-object' ); |
||||
|
||||
module.exports.tests = {}; |
||||
|
||||
module.exports.tests.interface = function (test, common){ |
||||
test('interface', function (t){ |
||||
t.ok( isObject( queryAdminWeights ), 'Module exports an object.' ); |
||||
for( var key in queryAdminWeights ){ |
||||
t.equal( typeof queryAdminWeights[ key ], 'number', 'Weight is a number.' ); |
||||
} |
||||
t.end(); |
||||
}); |
||||
}; |
||||
|
||||
module.exports.all = function (tape, common) { |
||||
|
||||
function test(name, testFunction) { |
||||
return tape('queryAdminWeights: ' + name, testFunction); |
||||
} |
||||
|
||||
for( var testCase in module.exports.tests ){ |
||||
module.exports.tests[testCase](test, common); |
||||
} |
||||
}; |
Loading…
Reference in new issue