diff --git a/test/specs/headers.spec.js b/test/specs/headers.spec.js index ffc725d5ff..05d0a5edfb 100644 --- a/test/specs/headers.spec.js +++ b/test/specs/headers.spec.js @@ -15,7 +15,7 @@ function testHeaderValue(headers, key, val) { if (!found) { if (typeof val === 'undefined') { - expect(headers.hasOwnProperty(key)).toEqual(false); + expect(Object.prototype.hasOwnProperty.call(headers, key)).toEqual(false); } else { throw new Error(key + ' was not found in headers'); } @@ -38,7 +38,7 @@ describe('headers', function () { getAjaxRequest().then(function (request) { for (const key in headers) { - if (headers.hasOwnProperty(key)) { + if (Object.prototype.hasOwnProperty.call(headers, key)) { expect(request.requestHeaders[key]).toEqual(headers[key]); } } @@ -59,7 +59,7 @@ describe('headers', function () { return getAjaxRequest().then(function (request) { for (const key in expectedHeaders) { - if (expectedHeaders.hasOwnProperty(key)) { + if (Object.prototype.hasOwnProperty.call(expectedHeaders, key)) { expect(request.requestHeaders[key]).toEqual(expectedHeaders[key]); } }