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

Consumer test using application/x-www-form-urlencoded content type is being serialised as JSON #1233

Open
5 tasks done
sandy-may opened this issue Aug 8, 2024 · 0 comments
Labels
bug Indicates an unexpected problem or unintended behavior triage This issue is yet to be triaged by a maintainer

Comments

@sandy-may
Copy link

sandy-may commented Aug 8, 2024

Software versions

Please provide at least OS and version of pact-js

  • OS: _e.g. Mac OSX 14.5
  • Consumer Pact library: _e.g. Pact JS v13.1.1
  • Provider Pact library: e.g. pact-jvm-provider-maven_2.11 v 3.3.8 n/a
  • Node Version: v20.16.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

The request body is passed through to the mock server respecting the Content-Type set in the request header of the Pact Interaction

Actual behaviour

It is being serialised into JSON. Log from the express mock server: { '{"grant_type":"client_credent': '' }

Steps to reproduce

How can someone else reproduce this bug?
https://github.com/J-son1/pact-url-encoded-bug
Guidance hopefully in Readme

Relevant log files

Log file with level set to debug: pact-content-type-bug.txt

@sandy-may sandy-may added bug Indicates an unexpected problem or unintended behavior triage This issue is yet to be triaged by a maintainer labels Aug 8, 2024
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

No branches or pull requests

1 participant