pact-foundation / jest-pact

A Pact adaptor for to allow you to easily run tests with Jest
https://pact.io
MIT License
81 stars 12 forks source link

Add cors flag in PactOptions #187

Closed benquinteros closed 4 years ago

benquinteros commented 4 years ago

Screen Shot 2020-04-30 at 11 09 13 am

Are we able to add the cors flag like so, would save having to manually mock a cors interaction.

mefellows commented 4 years ago

I'm wondering if it makes sense to have PactOptions duplicated in this package - could it not just reference the upstream PactOptions interface directly? This would mean it's always up-to-date with pact?

mefellows commented 4 years ago

It makes sense to me @benquinteros, but i'll let Tim/Yousaf comment as they are the maintainers of this repo.

YOU54F commented 4 years ago

agree with @mefellows, it is better to reference the interface from pact-js directly. Happy for a PR proposal 👍 otherwise I look to address in the next couple of days

TimothyJones commented 4 years ago

I remembered why we had a new type - it's because we add timeout to the options. But, you're right that it jest-pact should use the upstream PactOptions directly.

I've fixed this in #188 , which

I wanted to hold off merging for a bit of discussion - simple questions, but worth thinking about before we release a version 1:

It's worth keeping in mind that currently this is really also jasmine-pact as well as jest-pact, since it exclusively uses jasmine features.

TimothyJones commented 4 years ago

I forgot to close this issue before - this is fixed in 0.5.3.

It's technically a breaking change if you've explicitly used the type PactOptions, because I've renamed it to JestPactOptions - however, most people probably use it implicitly.

Since this is getting more traction, we'll release a version 1.0.0 soon, which will let us be clearer about breaking changes.