Skip to content

Single quote in consumer/provider names causes test failures #160

Closed
@TimothyJones

Description

Software versions

  • OS: Mac OSX 10.13.2
  • Consumer Pact library: "@pact-foundation/pact": "^5.7.0" (also current head)
  • Provider Pact library: NA
  • Node Version: v8.4.0

Expected behaviour

Consumer and provider names are allowed to contain single quote characters

Actual behaviour

If the consumer or provider names contain single quote characters, the pact mock server doesn't spin up correctly, and connections are refused.

Steps to reproduce

I've provided a branch that illustrates the problem in the Jest example:

  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

Observe that the examples fail.

You can observe the example passing with:

git checkout master
npm run test

Relevant log files

The following line in the log illustrates the problem - the consumer name is used directly on the command line, when it should be escaped:

[2018-03-15T02:21:06.884Z]  INFO: pact-node@6.11.0/63150 on Nightcrawler.dius.local: Created './platforms/darwin/bin/pact-mock-service service --consumer 'MyConsumer's Client' --pact_dir '/Users/work/office/test/pact-js/examples/jest/pacts' --host '127.0.0.1' --log '/Users/work/office/test/pact-js/examples/jest/logs/mockserver-integration.log' --pact-file-write-mode 'update' --port '8989' --provider 'MyProvider's Provider' --pact_specification_version '2'' process with PID: 63156

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions