Hello, I have a few questions about <the removal o...
# pact-js
g
Hello, I have a few questions about the removal of support for karma in pact-web: • As a Karma + pact user, am I right in thinking that my two options are (1) use a different test runner (and rewrite tests) or (2) pin pact-web to 9.17.x? • Will patch releases of 9.17.x always support pact-web? • Will 9.17.x receive any continuing support, e.g. security patches?
t
I'm not across the maintainer parts of your question (in case this is surprising, I stopped maintaining pact in January to focus on other things) - but unless you're using pact in a kind of integration test-like scenario where you're clicking buttons to cause API requests, it shouldn't require substantial rewrites of tests. You can make introducing a separate test runner straightforward with a pattern like
*.spec.ts
for regular tests and
*.spec.pact.ts
for pact - I sometimes do this if the pact run is large.
Also, you won't have to pin pact-web - pact-js no longer releases pact-web (which only existed to support karma etc)
You can see examples of ways to use pact-js (which will continue to release) with web apps in the examples folder.
m
Hi Greg,
Will patch releases of 9.17.x always support pact-web?
I don’t plan on releasing any new versions of Pact Web at this stage, but could be talked out of it for say a critical zero day vulnerability. Realistically, that package actually hasn’t changed significantly for years aside from dependency updates (it’s a thin shim API based on the real Pact JS). All of the functionality it has is actually in other packages (
pact-node
which will definitely still be maintained for a while, likely a year or more given it’s the current main core implementation for Pact JS, and in your case,
karma-pact
is still a thing). Karma pact is still maintained, albeit as you’ll probably have noted it receives very little attention and we don’t have any plans to support it during the next major upgrade of Pact JS (and the core module that powers it -
pact-core
)
Not saying it’s a good idea, but Pact Web could easily be pulled out of the current Pact JS project into it’s own module (as I said, it’s a fairly small API) and could be left in a separate repo/package that is then made to be compatible with
pact-karma
and
pact-node
if updates are really needed. As far as Pact is concerned, these packages have never really felt like first class citizens and don’t have a bunch of features that we’d like to have for parity and consistency. The idea of taking away something definitely pains me, but the maintenance burden has been weighing on us (it’s not just the code to manage, but failed builds, issues, community questions etc.) and the more we can focus on the core of the product the better for all. So, apologies I know it’s probably frustrating, but I hope you can appreciate the why now!
g
Thanks both, that certainly clears things up for me. My project currently involves a bunch of old tech (i.a. AngularJS 🙉), which is why we’re a bit trapped in Karma world, so ultimately this is just one more thing to push us towards modernising 💪
❤️ 1
🚀 1
m
You’re welcome - best of luck!!