test: use Object.hasOwn() where applicable

Replace Object.prototpye.hasOwnProperty() with Object.hasOwn() where
applicable.

PR-URL: https://github.com/nodejs/node/pull/41664
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tierney Cyren <hello@bnb.im>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
Rich Trott 2022-01-24 23:03:17 -08:00 committed by GitHub
parent ff5766fc2e
commit e2e2bc83c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 40 additions and 40 deletions

View file

@ -41,7 +41,7 @@ const expectedMethods = Object.keys(expectedHeaders);
const server = http.createServer(common.mustCall((req, res) => {
res.end();
assert(expectedHeaders.hasOwnProperty(req.method),
assert(Object.hasOwn(expectedHeaders, req.method),
`${req.method} was an unexpected method`);
const requestHeaders = Object.keys(req.headers);