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
If the consumer or provider names contain single quote characters, the pact mock server doesn't spin up correctly, and connections are refused.
I've provided a branch that illustrates the problem in the Jest example for pact-js:
git clone git@github.com:TimothyJones/pact-js.git
cd pact-js
git checkout single-quote-issue
npm i && npm run dist && cd examples/jest/ && npm i
npm run test
This happens because we escape the arguments here.
This escaping is necessary because we concatenate arguments to a single string here.
If we instead passed arguments as an array,child_process.spawn() will correctly escape them (docs here). However, windows quoting isn't straightforward (which might be why we started doing the quoting in the first place).
It looks like the cross-spawn package would work as a replacement for child_process that is better for Windows.
I haven't provided a PR because I don't have a windows machine I can test on - but I'm happy to roll one up if someone else is able to test it.
The text was updated successfully, but these errors were encountered:
(Originally reported against
pact-js
here)If the consumer or provider names contain single quote characters, the pact mock server doesn't spin up correctly, and connections are refused.
I've provided a branch that illustrates the problem in the Jest example for pact-js:
This happens because we escape the arguments here.
This escaping is necessary because we concatenate arguments to a single string here.
If we instead passed arguments as an array,
child_process.spawn()
will correctly escape them (docs here). However, windows quoting isn't straightforward (which might be why we started doing the quoting in the first place).It looks like the cross-spawn package would work as a replacement for
child_process
that is better for Windows.I haven't provided a PR because I don't have a windows machine I can test on - but I'm happy to roll one up if someone else is able to test it.
The text was updated successfully, but these errors were encountered: