Skip to content
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

MatchersV3.reify doesn't extract payload from MatchersV3.nullValue() #1229

Closed
5 tasks done
ledniov opened this issue Jul 12, 2024 · 4 comments · Fixed by #1230
Closed
5 tasks done

MatchersV3.reify doesn't extract payload from MatchersV3.nullValue() #1229

ledniov opened this issue Jul 12, 2024 · 4 comments · Fixed by #1230
Labels
bug Indicates an unexpected problem or unintended behavior triage This issue is yet to be triaged by a maintainer

Comments

@ledniov
Copy link

ledniov commented Jul 12, 2024

I'm using MatchersV3.reify in the project to strip Matchers from the object and use payload for assertion.
However, MatchersV3.nullValue() is not processed.

Software versions

  • OS: 22.04.2-Ubuntu
  • Consumer Pact library: Pact JS v13.1.0
  • Node Version: v18.19.0

Issue Checklist

Please confirm the following:

  • I have upgraded to the latest
  • I have the read the FAQs in the Readme
  • I have triple checked, that there are no unhandled promises in my code and have read the section on intermittent test failures
  • I have set my log level to debug and attached a log file showing the complete request/response cycle
  • For bonus points and virtual high fives, I have created a reproduceable git repository (see below) to illustrate the problem

Expected behaviour

MatchersV3.nullValue() is processed correctly and value is transformed to null

Actual behaviour

The reify method doesn't process MatchersV3.nullValue() matcher

Expected value to deeply and strictly equal to:
    {"nullProp": null, "stringProp": "sample string"}
Received:
    {"nullProp": {"pact:matcher:type": "null"}, "stringProp": "sample string"}

Steps to reproduce

See test - https://github.com/ledniov/pact-js-repro-template/blob/reify-bug/reify.spec.ts

Relevant log files

Github Actions runs - https://github.com/ledniov/pact-js-repro-template/actions/runs/9905937116

@ledniov ledniov added bug Indicates an unexpected problem or unintended behavior triage This issue is yet to be triaged by a maintainer labels Jul 12, 2024
mefellows added a commit that referenced this issue Jul 15, 2024
@mefellows
Copy link
Member

Thanks for spotting @ledniov, appreciate the repro too. I think the fix is straightforward, testing a build now.

@mefellows
Copy link
Member

This should be fixed now, please let us know how you get on.

@ledniov
Copy link
Author

ledniov commented Jul 17, 2024

@mefellows , appreciate the quick fix!
I already upgraded to the new version and everything works as expected.
Thank you!

@mefellows
Copy link
Member

Excellent, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior triage This issue is yet to be triaged by a maintainer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants