Browse Source

Test cases with a lower min query size

pull/1097/head
Julian Simioni 7 years ago
parent
commit
94946989bb
No known key found for this signature in database
GPG Key ID: B9EEB0C6EE0910A1
  1. 27
      test/unit/helper/sizeCalculator.js

27
test/unit/helper/sizeCalculator.js

@ -65,6 +65,33 @@ module.exports.tests.valid = function(test, common) {
t.end(); t.end();
}); });
}); });
test('no size, min query size 10', function (t) {
setup();
const calcSize = calcSizeMiddleware(10);
calcSize(req, {}, function () {
t.equal(req.clean.hasOwnProperty('querySize'), false);
t.end();
});
});
test('size 5, min query size 10', function (t) {
setup(5);
const calcSize = calcSizeMiddleware(10);
calcSize(req, {}, function () {
t.equal(req.clean.querySize, 10);
t.end();
});
});
test('size 3, min query size 2', function (t) {
setup(3);
const calcSize = calcSizeMiddleware(2);
calcSize(req, {}, function () {
t.equal(req.clean.querySize, 6);
t.end();
});
});
}; };
module.exports.all = function (tape, common) { module.exports.all = function (tape, common) {

Loading…
Cancel
Save