pact-foundation / pact-mock_service

Provides a mock service for use with Pact
https://pact.io
MIT License
73 stars 69 forks source link

Slash in consumer or provider name results in folders being created #81

Open TimothyJones opened 6 years ago

TimothyJones commented 6 years ago

When the consumer or provider name contains a slash, the slash is passed through to the file system, which creates folders:

Expected behaviour

Full pact file is present in the pacts/ folder, something like: pacts/a_b client-a_b api.json

Alternatively, some kind of error that provider/consumer names are not allowed to contain slashes.

Actual behaviour

Pact file in a few folders deep: pacts/a/b client-a/b api.json

Steps to reproduce

Use the following pact() call when using pact-js:

  const provider = pact({
    consumer: 'A/B Client',
    provider: 'A/B API',
    port,
    done: error => expect(error).to.be.null
  });
TimothyJones commented 6 years ago

Originally opened as https://github.com/pact-foundation/pact-js/issues/126