Skip to content

fix: mock backend to return the example value provided in date and time v3 matchers#1405

Merged
mefellows merged 1 commit into
pact-foundation:masterfrom
pulak777:fix-v3-date-time-matchers
Apr 1, 2025
Merged

fix: mock backend to return the example value provided in date and time v3 matchers#1405
mefellows merged 1 commit into
pact-foundation:masterfrom
pulak777:fix-v3-date-time-matchers

Conversation

@pulak777

Copy link
Copy Markdown
Contributor
  • npm run dist works locally (this will run tests, lint and build)
  • Commit messages are ready to go in the changelog (see below for details)
  • PR template filled in (see below for details)

PR Template

Currently while using MatchersV3 date and time, mock backend returns current date instead of the provided example date.

This works correctly for datetime. So this pr applies similar fix to what was done in datetime (removing pact:generator:type from output object when example value is present)

Added some tests in pact-reference for this scenario as well - pact-foundation/pact-reference#489

@pulak777

Copy link
Copy Markdown
Contributor Author

Looks like there's been a discussion on this before - #1076

@pulak777 pulak777 force-pushed the fix-v3-date-time-matchers branch from b4f2512 to 95ccccd Compare March 18, 2025 10:53
@mefellows mefellows merged commit 5f47e5d into pact-foundation:master Apr 1, 2025
@mefellows

Copy link
Copy Markdown
Member

Thanks!

@pulak777

pulak777 commented Apr 1, 2025

Copy link
Copy Markdown
Contributor Author

Thank you @mefellows. From this comment and the commit where the example was made mandatory, it looks like we can make the example input optional. As rust ffi generates example value from the given regex (which probably was not the case then)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants