Hi there, I am a developer implementing contract t...
# pact-js
r
Hi there, I am a developer implementing contract testing within an organization. I have successfully implemented it in java backend services and I am now implementing it in a consuming frontend application. The test framework used in that application is Karma/Jasmine. While I was implementing PactJS in the application, I learned that Karma support for PactJS and newer Karma versions has stopped. So I have switched to using Jest for Pact contract tests. Now my question: It seems that using both Jest and Jasmine/Karma in one Angular project is causing type conflicts. The frontend developers don't have the best experience with Jest and don't want to switch to Jest for all tests. So what to do? Is there a workaround to use PactJS with newer Karma versions? Or does anyone have experience with using both Jest and Jasmine in one project?
a
i've never gotten them to play nicely together personally i have an old angularjs project right now that im considering using jest with playwright
t
Pact generally doesn’t need Karma
it’s for the API client, which shouldn’t need anything to do with the browser
Now my question: It seems that using both Jest and Jasmine/Karma in one Angular project is causing type conflicts.
What problems are you running into? This doesn’t sound right
r
But it needs a testrunner, right? I agree that the consuming angular service doesn't need a browser (karma).
Combining Jest and Jasmine is resulting in type conflicts
t
What is the specific error that you’re getting?
I can probably help, but not without more details
r
Thanks for your reply. I've managed to fix the conflicting types issue by adding a tsconfig for *contract.ts files that only knows the type "jest". Now that I only have jasmine/karma defined in the tsconfig for *spec.ts, it doesn't complain about it anymore.