Closed callumbooth closed 2 years ago
Thanks, should the title be "Allow term matcher to generate integers" (on "non strings"?)
Yes, at the current time, you cannot generate non-string values for a regex.
Our next major release of Pact (https://github.com/pact-foundation/pact-js#pact-js-v3) would let you do this if you wanted to try it?
yes, the title should be integers. I'll take a look at v3 and get back to you.
10.x.x supports this.
Issue Classification
Bug Report
Might be related to #435 but currently it's not possible to use the term matcher with integers.
Software versions
NOTE: only applicable for bug reports
node --version
Issue Checklist
Confirm the following:
Expected behaviour
I should be able to use
term()
to generate integer values. Passingterm({generate: '0', matcher: '0|1'})
is not suitable because the contract json file it generates will check against a string type rather than the integer type.Actual behaviour
When passing
term({generate: 0, matcher: '0|1'})
you get the messageError ocurred in mock service: RuntimeError - Value to generate \\\"0\\\" does not match regular expression...
.