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
Type definitions allow only strings to be passed as values.
Possible solution
Extend type definitions to include all supported types.
How to reproduce the issue
See the example code above. It will result in the TypeScript compiler error: Argument of type '{ number: number; }' is not assignable to parameter of type 'string | RegExp | Buffer | DataMatcher | ((body: any) => boolean) | undefined'.
Does the bug have a test case?
I guess it's not currently in the codebase.
Versions
Software
Version(s)
Nock
v11.3.2
Node
v10.16.3
The text was updated successfully, but these errors were encountered:
What is the expected behavior?
I'd expect to be able to provide objects with any JSON-parseable value as request matcher, like so:
What is the actual behavior?
Type definitions allow only strings to be passed as values.
Possible solution
Extend type definitions to include all supported types.
How to reproduce the issue
See the example code above. It will result in the TypeScript compiler error:
Argument of type '{ number: number; }' is not assignable to parameter of type 'string | RegExp | Buffer | DataMatcher | ((body: any) => boolean) | undefined'.
Does the bug have a test case?
I guess it's not currently in the codebase.
Versions
The text was updated successfully, but these errors were encountered: