diff --git a/lib/units/validateBody.js b/lib/units/validateBody.js index 858d5dbf..a54c124c 100644 --- a/lib/units/validateBody.js +++ b/lib/units/validateBody.js @@ -197,15 +197,13 @@ function validateBody(expected, actual) { if (realTypeError) { errors.push({ - message: realTypeError, - values + message: realTypeError }); } if (expectedTypeError) { errors.push({ - message: expectedTypeError, - values + message: expectedTypeError }); } @@ -227,13 +225,11 @@ function validateBody(expected, actual) { errors.push({ message: `Expected "body" of "${mediaTyper.format( expectedType - )}" media type, but actual "body" is missing.`, - values + )}" media type, but actual "body" is missing.` }); } else { errors.push({ - message: validatorError, - values + message: validatorError }); } } diff --git a/lib/units/validateHeaders.js b/lib/units/validateHeaders.js index 5d5aaef2..2098c86d 100644 --- a/lib/units/validateHeaders.js +++ b/lib/units/validateHeaders.js @@ -43,8 +43,7 @@ No validator found for real data media type "${actualType}" and expected data media type "${expectedType}".\ -`, - values +` }); } diff --git a/lib/units/validateMethod.js b/lib/units/validateMethod.js index ba30ef09..69620c25 100644 --- a/lib/units/validateMethod.js +++ b/lib/units/validateMethod.js @@ -8,8 +8,7 @@ function validateMethod(expected, actual) { if (!valid) { errors.push({ - message: `Expected method '${values.expected}', but got '${values.actual}'.`, - values + message: `Expected method '${values.expected}', but got '${values.actual}'.` }); } diff --git a/lib/units/validateStatusCode.js b/lib/units/validateStatusCode.js index 9d867dd9..dc1c83ab 100644 --- a/lib/units/validateStatusCode.js +++ b/lib/units/validateStatusCode.js @@ -13,8 +13,7 @@ function validateStatusCode(expected, actual) { if (!valid) { errors.push({ - message: `Expected status code '${values.expected}', but got '${values.actual}'.`, - values + message: `Expected status code '${values.expected}', but got '${values.actual}'.` }); } diff --git a/lib/units/validateURI.js b/lib/units/validateURI.js index 8c5a6cb9..71fa828c 100644 --- a/lib/units/validateURI.js +++ b/lib/units/validateURI.js @@ -37,8 +37,7 @@ const validateURI = (expected, actual) => { if (!valid) { errors.push({ - message: `Expected URI '${values.expected}', but got '${values.actual}'.`, - values + message: `Expected URI '${values.expected}', but got '${values.actual}'.` }); } diff --git a/package-lock.json b/package-lock.json index f6ffeec1..7437869a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2327,9 +2327,9 @@ "dev": true }, "gavel-spec": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/gavel-spec/-/gavel-spec-4.0.0.tgz", - "integrity": "sha512-+8hBF2qyrCpos47y9+PjL0FL5ZwIwvfW7W/RQKLq6X1GJ8C5/KHPLrjOcuRdpwMrz1C7HYPGgYCBuaE3a4iWew==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/gavel-spec/-/gavel-spec-4.1.0.tgz", + "integrity": "sha512-G2SRbTMFYQTMHvXsNZXv5zddEVs0mm2YaJqCq40hmdF6Xzb5iNLIRC7g2EpgMe9YzOjvRu/uQjNloBGHIESpsg==", "dev": true }, "get-caller-file": { diff --git a/package.json b/package.json index 78a6dc31..539c9e52 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "eslint-config-airbnb-base": "13.2.0", "eslint-config-prettier": "6.0.0", "eslint-plugin-import": "2.18.2", - "gavel-spec": "4.0.0", + "gavel-spec": "4.1.0", "husky": "3.0.2", "lint-staged": "9.2.1", "mocha": "6.2.0", diff --git a/test/integration/validate.test.js b/test/integration/validate.test.js index f39e1f4f..cb6c1aea 100644 --- a/test/integration/validate.test.js +++ b/test/integration/validate.test.js @@ -297,15 +297,6 @@ describe('validate', () => { .to.have.errorAtIndex(0) .withMessage(`Expected method 'POST', but got 'PUT'.`); }); - - it('includes values', () => { - expect(result.fields.method) - .to.have.errorAtIndex(0) - .withValues({ - expected: 'POST', - actual: 'PUT' - }); - }); }); }); }); diff --git a/test/unit/units/validateBody.test.js b/test/unit/units/validateBody.test.js index 480daac9..66e2a0d4 100644 --- a/test/unit/units/validateBody.test.js +++ b/test/unit/units/validateBody.test.js @@ -51,15 +51,6 @@ describe('validateBody', () => { `Can't validate actual media type 'application/json' against the expected media type 'text/plain'.` ); }); - - it('includes values', () => { - expect(result) - .to.have.errorAtIndex(0) - .withValues({ - expected: '', - actual: '{ "foo": "bar" }' - }); - }); }); }); diff --git a/test/unit/units/validateMethod.test.js b/test/unit/units/validateMethod.test.js index d5629846..4354bdcd 100644 --- a/test/unit/units/validateMethod.test.js +++ b/test/unit/units/validateMethod.test.js @@ -53,15 +53,6 @@ describe('validateMethod', () => { .to.have.errorAtIndex(0) .withMessage(`Expected method 'POST', but got 'GET'.`); }); - - it('includes values', () => { - expect(result) - .to.have.errorAtIndex(0) - .withValues({ - expected: 'POST', - actual: 'GET' - }); - }); }); }); @@ -93,15 +84,6 @@ describe('validateMethod', () => { .to.have.errorAtIndex(0) .withMessage(`Expected method 'PATCH', but got ''.`); }); - - it('includes values', () => { - expect(result) - .to.have.errorAtIndex(0) - .withValues({ - expected: 'PATCH', - actual: '' - }); - }); }); }); }); diff --git a/test/unit/units/validateStatusCode.test.js b/test/unit/units/validateStatusCode.test.js index d510ed7c..ea9b7bc5 100644 --- a/test/unit/units/validateStatusCode.test.js +++ b/test/unit/units/validateStatusCode.test.js @@ -53,15 +53,6 @@ describe('validateStatusCode', () => { .to.have.errorAtIndex(0) .withMessage(`Expected status code '400', but got '200'.`); }); - - it('includes values', () => { - expect(result) - .to.have.errorAtIndex(0) - .withValues({ - expected: '400', - actual: '200' - }); - }); }); }); }); diff --git a/test/unit/units/validateURI.test.js b/test/unit/units/validateURI.test.js index de706cba..1ecc5b82 100644 --- a/test/unit/units/validateURI.test.js +++ b/test/unit/units/validateURI.test.js @@ -129,15 +129,6 @@ describe('validateURI', () => { .to.have.errorAtIndex(0) .withMessage(`Expected URI '/dashboard', but got '/profile'.`); }); - - it('includes values', () => { - expect(result) - .to.have.errorAtIndex(0) - .withValues({ - expected: '/dashboard', - actual: '/profile' - }); - }); }); }); @@ -172,15 +163,6 @@ describe('validateURI', () => { `Expected URI '/account?id=123', but got '/account'.` ); }); - - it('includes values', () => { - expect(result) - .to.have.errorAtIndex(0) - .withValues({ - expected: '/account?id=123', - actual: '/account' - }); - }); }); }); @@ -214,15 +196,6 @@ describe('validateURI', () => { `Expected URI '/account?name=user', but got '/account?nAmE=usEr'.` ); }); - - it('includes values', () => { - expect(result) - .to.have.errorAtIndex(0) - .withValues({ - expected: '/account?name=user', - actual: '/account?nAmE=usEr' - }); - }); }); }); @@ -256,15 +229,6 @@ describe('validateURI', () => { `Expected URI '/zoo?type=cats&type=dogs', but got '/zoo?type=dogs&type=cats'.` ); }); - - it('includes values', () => { - expect(result) - .to.have.errorAtIndex(0) - .withValues({ - expected: '/zoo?type=cats&type=dogs', - actual: '/zoo?type=dogs&type=cats' - }); - }); }); }); });