Skip to content

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

@ledniov

Description

@ledniov

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviortriageThis issue is yet to be triaged by a maintainer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions