NagRock / ts-mockito

Mocking library for TypeScript
MIT License
969 stars 93 forks source link

Argument count of mocked method #201

Open flugg opened 3 years ago

flugg commented 3 years ago

Hi. Love the library, but having an issue where my code is checking the expected number of parameters of a function and only sending a value based on the count. However, a mocked function will always return 0 for myFunction.length. Any way to bypass this?

Also, somewhat related, at the moment you need to do when(myFunction(anything(), anything())).then..., any way to tell it to do something without predefining the count of arguments? Something like when(myFunction).then...

Thanks in advance!