pact-foundation / pact-net

.NET version of Pact. Enables consumer driven contract testing, providing a mock service and DSL for the consumer project, and interaction playback and verification for the service provider project.
https://pact.io
MIT License
848 stars 234 forks source link

PactV3Options Port value not respected #480

Closed daTooz closed 1 year ago

daTooz commented 1 year ago

I am attempting to new up a PactV3 using PactV3Options but it appears that the port property value is not respected...

const provider = new PactV3({ consumer: "consumer", provider: "provider", //log: path.resolve(process.cwd(), "logs", "pact.log"), //logLevel: "debug", dir: path.resolve(process.cwd(), "pacts"), spec: SpecificationVersion.SPECIFICATION_VERSION_V3, host: "localhost", port: 9999 });

...whether or not the port value is set, the mockerserver is assigning a random port.

NOTES:

  1. The host value is respected.
  2. "@pact-foundation/pact": "^12.1.0",
  3. .Net Core 7.x
YOU54F commented 1 year ago

Hey, that is pact-js you are using and this is the pact-net repo. did you mean to raise this issue against https://github.com/pact-foundation/pact-js

daTooz commented 1 year ago

@YOU54F thank you for the prompt response. I am using pact-net and the behavior is exhibiting using C# .net 7. Thanks!

YOU54F commented 1 year ago
  1. "@pact-foundation/pact": "^12.1.0",

This is pact-js

https://www.npmjs.com/package/@pact-foundation/pact

pact-nets packages are from nuget

https://www.nuget.org/packages/PactNet/

Your code snippet does not show .NET code

daTooz commented 1 year ago

Thank you! I have multiple IDEs open. You are correct. Thank you!