mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 21:58:48 +02:00
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:
parent
ff5766fc2e
commit
e2e2bc83c0
21 changed files with 40 additions and 40 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue