-
-
Notifications
You must be signed in to change notification settings - Fork 350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Two StateHandler types defined #1057
Comments
…lers` from `StateHandlers` avoiding the conflicting type problem introduced in pact-foundation#882. Fixes pact-foundation#1057
I raised a PR that fixes this. |
Hi there 👋 I was facing the same problem and stumbled upon this issue. I followed the slack thread linked in the issue and tried to workaround this but I still faced some issues. While the PR is under review, I was hoping to get some help with the suggested workaround:
Error:
TIA 💙 |
I don't think that workaround would work unless you defined your own The workaround I suggested was in the thread was:
PS: The PR is #1062. Sorry I forgot to link it before. |
Thanks, @TimothyJones :) I am quite new to TypeScript and I think I will take some time to learn a lot of concepts here (probably the PR will merge in before that 😓 ) If I understand correctly, OP did not use However, while checking out the
Then, I "shimmy-ed" the
Once, I did that, the type compatibility issues did not occur:
However, with this implementation, I am getting a
|
Software versions
Issue Checklist
Please confirm the following:
I raised this in the pact-js slack channel and was asked to raise this issue.
Expected behaviour
Creating StateHandlers as per the documentation results in no Typing errors from TS.
Actual behaviour
When attempting to use the setup/teardown properties on the provider state handlers Typescript complains that it doesn't match the type it's expecting. TS is finding two types with the same name and merging them (StateHandlers I believe). It gives the error:
Steps to reproduce
Create a state handler definition such as:
TS will complain as above.
As a workaround, we've created a shim type. An alternative as mentioned by @TimothyJones in the slack thread is to define your own StateHandler type until this is fixed up.
Relevant log files
N/A
The text was updated successfully, but these errors were encountered: