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
Setting up unit tests for PactSwift verifying various query parameter usage including time and datetime matchers. When executing the API request and Pact verification, verification fails:
QueryMismatch: Unable to match ["12:13:00"] using Time("HH:mm:ss")
Expected: ["12:13:00"]
Actual: ["12:13:00"]
Parameter: $.item])"
🦶 Reproduction Steps
Steps to reproduce the behaviour:
Setup a pact interaction that expects a query parameter,
Set query parameter with a time (or datetime) value matching the matcher’s format, ie: 10:13 or 10:13:00,
Pact test should succeed when GET request contains exactly the same query parameter as set for the value of the matcher.
Pact test should succeed when GET request contains any valid (date)time value matching the (date)time format set in the matcher
😲 Actual Results
Pact test fails when using Time matcher and sending the request with query parameter value matching the time format set in pact matcher.
Pac test fails when using Datetime matcher and sending the request with query parameter value matching the datetime format set in pact matcher.
The text was updated successfully, but these errors were encountered:
surpher
changed the title
Using time matcher in a query parameter failing verification
Matchers: Using time matcher in a query parameter failing verification
Jan 28, 2025
This is a regression (and I assume the other issues are as well).
It's applying the matcher to the collection, not the values in the collection. Note the square brackets: Unable to match ["12:13:00"] using Time("HH:mm:ss")
🌎 Environment
pact_ffi
0.4.25
v3
,v4
💬 Description
Setting up unit tests for
PactSwift
verifying various query parameter usage including time and datetime matchers. When executing the API request and Pact verification, verification fails:🦶 Reproduction Steps
Steps to reproduce the behaviour:
10:13
or10:13:00
,"pact:matcher:type”: "time”
,”format”: “HH:mm”
(orHH:mm:ss
),GET /endpoint?value=12:13:00
,🤔 Expected Results
GET
request contains exactly the same query parameter as set for thevalue
of the matcher.GET
request contains any valid (date)time value matching the (date)time format set in the matcher😲 Actual Results
Pact test fails when using
Time
matcher and sending the request with query parameter value matching the time format set in pact matcher.Pac test fails when using
Datetime
matcher and sending the request with query parameter value matching the datetime format set in pact matcher.🌳 Logs
📄 Stack Traces
See attached
query-param-time-matcher-issue.log
for fullstandardOut: .trace
log:query-param-time-matcher-issue.log
🤝 Relationships
The text was updated successfully, but these errors were encountered: