Browse Source

Add tests for the query weights config.

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
parent
commit
daa767568d
  1. 29
      test/unit/config/queryAdminWeights.js
  2. 3
      test/unit/run.js

29
test/unit/config/queryAdminWeights.js

@ -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);
}
};

3
test/unit/run.js

@ -22,7 +22,8 @@ var tests = [
require('./query/reverse'), require('./query/reverse'),
require('./helper/geojsonify'), require('./helper/geojsonify'),
require('./helper/outputSchema'), require('./helper/outputSchema'),
require('./helper/queryMixer') require('./helper/queryMixer'),
require('./config/queryAdminWeights')
]; ];
tests.map(function(t) { tests.map(function(t) {

Loading…
Cancel
Save