You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Strangely if you use null for the requestBody it does work - but null is not allowed by the TypeScript types which specificy requestBody must be undefined | RequestBody and the RequestBody type does not include null in its union.
Expected is that when using undefined for a requestBody the reqheaders matching still works.
Please avoid duplicates
Reproducible test case
https://github.com/josephearl/nock-reqheaders-repro
Nock Version
13.3.7
Node Version
v18.17.1
TypeScript Version
N/A
What happened?
When creating a request matcher and using
reqheaders
, these do not work when setting an undefinedrequestBody
:Strangely if you use
null
for therequestBody
it does work - butnull
is not allowed by the TypeScript types which specificyrequestBody
must beundefined | RequestBody
and theRequestBody
type does not includenull
in its union.Expected is that when using
undefined
for arequestBody
thereqheaders
matching still works.See https://github.com/josephearl/nock-reqheaders-repro/tree/main for a reproducer.
NB: the
all open bugs
link (https://github.com/nock/nock.js/issues?q=is%3Aissue+is%3Aopen+label%3Abug) in your issue template leads to a 404 - because it is pointing to an old repo namenock.js
Would you be interested in contributing a fix?
The text was updated successfully, but these errors were encountered: