This is a very specific case, and this is the first time I've thought of doing this, so let me first start by giving some context.
I'm doing API consumer-driven contract testing with Pact. The consumer app (client web app) works with a mock service so that development and demo can be done faster. The actual service is also being developed, and we plan to swap the integrations.
So we have 2 providers, 1 consumer. Since the 2 providers are essentially the same thing, I find it pointless writing 2 test files for the Pact tests. I'd be better to write 1 test suite, and then run both providers on it. Otherwise, we'd have to maintain the 2 files with the exact same tests and that's not DRY.
Is there a way I can write a Jest test suite, and then pass it the SUT I want to run the tests cases on?
I realized since both providers are exactly the same, there's no point in running the test suite twice. Instead, I just copied the pact and change it's name.