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

[V3] iso8601DateTime matcher fails to reflect example value in mock server response #620

Closed
4 of 5 tasks
audunhalland opened this issue Mar 3, 2021 · 4 comments
Closed
4 of 5 tasks
Assignees
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@audunhalland
Copy link
Contributor

audunhalland commented Mar 3, 2021

Software versions

Please provide at least OS and version of pact-js

  • OS: e.g. Mac OSX 10.15.6
  • Consumer Pact library: e.g. Pact JS @10.0.0-beta.32
  • Node Version: v14.15.4

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
  • 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

using e.g.

body: {
   foo: MatchersV3.iso8601DateTime("yyyy-MM-dd'T'HH:mm:ss.SSSX", '2000-01-01T00:00:00.000Z')
}

I'm expecting to have the string '2000-01-01T00:00:00.000Z' returned from the mock server for field foo.

Actual behaviour

The mock server instead returns a string representing the current time.

Steps to reproduce

Create a consumer pact that uses a datetime matcher and an example value.

Relevant log files

[2021-03-03T00:26:22Z DEBUG pact_matching::models::generators] Applying generator DateTime(Some("yyyy-MM-dd\'T\'HH:mm:ss.SSSX")) to key $[*].lastPublishedAt
[2021-03-03T00:26:22Z DEBUG pact_matching::json] Generating value from DateTime(Some("yyyy-MM-dd\'T\'HH:mm:ss.SSSX")) with context {"mockServer": Object({"href": String("http://127.0.0.1:51778"), "port": Number(51778)})}
[2021-03-03T00:26:22Z DEBUG pact_matching::json] Generated value = Ok(String("2021-03-03T01:26:22.263+01:00"))
@audunhalland audunhalland added the bug Indicates an unexpected problem or unintended behavior label Mar 3, 2021
@mefellows mefellows self-assigned this Mar 3, 2021
@mefellows
Copy link
Member

Thanks @audunhalland, easy fix and much appreciated.

@mefellows
Copy link
Member

This should be fixed in the latest release @audunhalland - let me know!

@audunhalland
Copy link
Contributor Author

Currently unable to test beta 33 because I get

node-pre-gyp info check checked for "/Users/audun/dev/uf/graphql-gateway/node_modules/@pact-foundation/pact/native/index.node" (not found)
node-pre-gyp http GET https://github.com/pact-foundation/pact-js/releases/download/v10.0.0-beta.33/node-v83-darwin-x64-unknown.tar.gz
node-pre-gyp http 404 https://github.com/pact-foundation/pact-js/releases/download/v10.0.0-beta.33/node-v83-darwin-x64-unknown.tar.gz

@mefellows
Copy link
Member

Gah! It looks like when I "fixed" it (the release process) last time, I only fixed it in the v3 branch. It needed the github change in master also - I've just fixed it (again). Thanks and apologies.

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
Projects
None yet
Development

No branches or pull requests

2 participants