Hello, Can someone point me to how to set the "pen...
# pact-js
m
Hello, Can someone point me to how to set the "pending" flag per interaction in Pact TS consumer tests? In the Python implementation, this is done by calling .set_pending(pending=True).
m
hmmm pending pacts is a dynamic calculation: docs.pact.io/pending
@Joshua Ellis @rholshausen see https://github.com/pact-foundation/pact-python/blob/65f246988a53497d97aa90da3a615df98c9c7055/src/pact/interaction/_base.py#L424-L432 I assume this refers to https://github.com/pact-foundation/pact-specification/issues/73. How does this work downstream - do the verifiers honour it and does the broker need to know about it?
r
Verifier honours the flag, whether returned by the broker or set on the interaction.
I think Pact-JS jsut needs to add a method to set it
m
OK cool, should be easy enough to do.
r
Copy code
if (brokerSays.pending || interaction.pending) {
  // interaction must be pending
👍 1
m
nice
I assume this works on all interaction types (messages included)?
r
Only V4 Pacts, any interaction
👍 1
The only way to unset it is to publish a new Pact
👍 1
m
i.e. publish a new pact, but removing the flag?
r
yes
m
thanks. Looks like I can support adding comments, text and test name (based on that same code above). I’ll get them done together.
See https://github.com/pact-foundation/pact-js/pull/1693. Let me know if that looks OK, and we can get it merged/released
❤️ 1
😆
cat typing 2