You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Having a request in the interaction that specifies "Content-Type": "application/x-www-form-urlencoded" and an url-encoded body makes the consumer tests fail with BodyMismatch
Software versions
OS: Ubuntu 20
Consumer Pact library: Pact JS v10.0.0-beta.25
Provider Pact library: Pact JS v10.0.0-beta.25
Node Version: v12.20.1
Issue Checklist
Confirm the following:
I have upgraded to the latest
I have created a reproducable git repository (see below) to illuminate the problem
I have the read the FAQs in the Readme
I have triple checked, that there are no unhandled promises in my code
I have set my log level to debug and attached a log file showing the complete request/response cycle
Expected behaviour
tests should not fail when the correct form-data is send
Actual behaviour
tests fail saying they expect an extra 34 at the beginning and the end of the data
Steps to reproduce
create an interaction with a request that uses content-type and a url-encoded body e.g.
1) Pact V3
when a call to the Animal Service is made to create a new mate using form-data body
creates a new mate with application/x-www-form-urlencoded:
Error: Test failed for the following reasons:
Test code failed with an error: expected promise to be fulfilled but it was rejected with 'Error: Internal Server Error'
Mock server failed with the following mismatches:
1) BodyMismatch (at $) Expected text '[34, 102, 105, 114, 115, 116, 95, 110, 97, 109, 101, 61, 78, 97, 110, 110, 121, 38, 108, 97, 115, 116, 95, 110, 97, 109, 101, 61, 68, 111, 101, 34]' but received '[102, 105, 114, 115, 116, 95, 110, 97, 109, 101, 61, 78, 97, 110, 110, 121, 38, 108, 97, 115, 116, 95, 110, 97, 109, 101, 61, 68, 111, 101]'
at /home/artur/www/pact/pact-js/examples/v3/e2e/node_modules/@pact-foundation/src/v3/pact.ts:152:33
at processTicksAndRejections (internal/process/task_queues.js:97:5)
The text was updated successfully, but these errors were encountered:
Issue Classification
Bug Report
Having a request in the interaction that specifies
"Content-Type": "application/x-www-form-urlencoded"
and an url-encoded body makes the consumer tests fail withBodyMismatch
Software versions
Issue Checklist
Confirm the following:
Expected behaviour
tests should not fail when the correct form-data is send
Actual behaviour
tests fail saying they expect an extra
34
at the beginning and the end of the dataSteps to reproduce
Example:
feat/v3.0.0
branch: https://github.com/individual-it/pact-js/commit/0ce2d49d4bd87262b72f39888d4032f0158f4c92)examples/v3/e2e
run consumer tests:npm install; npm run test:consumer
sending extra quotes
"
at the beginning and the end of the body make the test passRelevant log files
The text was updated successfully, but these errors were encountered: