Quick q: Are there any ways you can add objects in...
# pact-js
a
Quick q: Are there any ways you can add objects in the pact file?
If I wanted to add another object, without actually writing it in manually, would I be able to do it in the spec file
message has been deleted
m
why do you want to do that? You could, but then you run the risk that what’s in the pact file is not what your code actually does
also, the next time you run your pact tests, they could be overwritten
a
I want to version my pact files
What would you recommend is the best way to go about that
m
The pact broker does this
There is a whole guide on versioning at docs.pact.io, I'd definitely recommend starting there!
a
Hey I've read the linked docs, the pact broker seems to be doing the versioning for you, only thing is, I'm using my own pact broker so I need to do my own versioning.
The only way I can think of to version the files, is to change the names of the consumers or providers in the pact file to their respective versions. That way the file is named with the versions
m
you don’t version the pact files. The Pact Broker (which you are running) does this
you version the applications (consumer or provider)
Users of Pact never need to worry about pact contract versions, since this is done automatically by the pact broker. However, consumer and provider application numbers need to be set in a principled way, even in pre-production.