Closed maze-le closed 3 years ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This will be fixed in #437 .
@mefellows That PR was merged, can this be closed?
Yep, I guess so!
Software versions
Expected behaviour
The typings for the property:
consumer
in aMessageProviderOptions
object should be optional. It actually works, if I trick the typescript-processor to ignore the type of theMessageProviderOptions
object.Actual behaviour
The property:
consumer
in aMessageProviderOptions
object, used to initialize aMessageProviderPact
is not optional. But I have a Provider that communicates with different Consumers. In this case, I would like to omit theconsumer
property, and define my handlers without specifying a concrete consumer.Steps to reproduce
This gives me the following error when I try to run the test with jest/ts-node:
Interestingly, I can trick typescript into accepting the options object without the
consumer
property, by coercing the object as top-type<any>
and it works:It would be very nice, if the type of the
MessageProviderOptions
object would reflect that behaviour, so I don't have to trick the typescript-processor into accepting it anyway.