This commit is contained in:
Daniel García Aubert
2018-04-17 11:36:33 +02:00
parent 9905b20448
commit 6c466d13ff
2 changed files with 10 additions and 10 deletions
+2 -2
View File
@@ -1,13 +1,13 @@
const positiveIntegerNumberRegExp = /^\d+$/;
const integerNumberRegExp = /^-?\d+$/;
const invalidZoomMessage = function (zoom) {
return `Invalid zoom value (${zoom}). It should be an integer number greather or equal to 0`;
return `Invalid zoom value (${zoom}). It should be an integer number greather than or equal to 0`;
};
const invalidCoordXMessage = function (x) {
return `Invalid coodinate 'x' value (${x}). It should be an integer number`;
};
const invalidCoordYMessage = function (y) {
return `Invalid coodinate 'y' value (${y}). It should be an integer number greather or equal to 0`;
return `Invalid coodinate 'y' value (${y}). It should be an integer number greather than or equal to 0`;
};
module.exports = function coordinates (validate = { z: true, x: true, y: true }) {
@@ -16,7 +16,7 @@ describe('coordinates middleware', function () {
coords(req, res, function (err) {
assert.equal(
err.message,
'Invalid zoom value (-1). It should be an integer number greather or equal to 0'
'Invalid zoom value (-1). It should be an integer number greather than or equal to 0'
);
assert.equal(err.http_status, 400);
done();
@@ -37,7 +37,7 @@ describe('coordinates middleware', function () {
coords(req, res, function (err) {
assert.equal(
err.message,
'Invalid zoom value (1.1). It should be an integer number greather or equal to 0'
'Invalid zoom value (1.1). It should be an integer number greather than or equal to 0'
);
assert.equal(err.http_status, 400);
done();
@@ -58,7 +58,7 @@ describe('coordinates middleware', function () {
coords(req, res, function (err) {
assert.equal(
err.message,
'Invalid zoom value (0.1). It should be an integer number greather or equal to 0'
'Invalid zoom value (0.1). It should be an integer number greather than or equal to 0'
);
assert.equal(err.http_status, 400);
done();
@@ -80,7 +80,7 @@ describe('coordinates middleware', function () {
coords(req, res, function (err) {
assert.equal(
err.message,
'Invalid zoom value (wadus). It should be an integer number greather or equal to 0'
'Invalid zoom value (wadus). It should be an integer number greather than or equal to 0'
);
assert.equal(err.http_status, 400);
done();
@@ -171,7 +171,7 @@ describe('coordinates middleware', function () {
coords(req, res, function (err) {
assert.equal(
err.message,
`Invalid coodinate 'y' value (-1). It should be an integer number greather or equal to 0`
`Invalid coodinate 'y' value (-1). It should be an integer number greather than or equal to 0`
);
assert.equal(err.http_status, 400);
done();
@@ -192,7 +192,7 @@ describe('coordinates middleware', function () {
coords(req, res, function (err) {
assert.equal(
err.message,
`Invalid coodinate 'y' value (1.1). It should be an integer number greather or equal to 0`
`Invalid coodinate 'y' value (1.1). It should be an integer number greather than or equal to 0`
);
assert.equal(err.http_status, 400);
done();
@@ -213,7 +213,7 @@ describe('coordinates middleware', function () {
coords(req, res, function (err) {
assert.equal(
err.message,
`Invalid coodinate 'y' value (wadus). It should be an integer number greather or equal to 0`
`Invalid coodinate 'y' value (wadus). It should be an integer number greather than or equal to 0`
);
assert.equal(err.http_status, 400);
done();
@@ -249,7 +249,7 @@ describe('coordinates middleware', function () {
coords(req, res, function (err) {
assert.equal(
err.message,
'Invalid zoom value (-1.1). It should be an integer number greather or equal to 0'
'Invalid zoom value (-1.1). It should be an integer number greather than or equal to 0'
);
assert.equal(err.http_status, 400);
done();