Hey all, good evening! I was wondering what the re...
# general
b
Hey all, good evening! I was wondering what the recommended approach would be when using Pactflow between Android/iOS apps and the services they communicate with (and if this is even recommended at all, as it seems quite difficult to find articles/docs on this). Integration tests can ensure that software modules which depend on each other correctly work together, and Pact tests are not supposed to be end-to-end integration tests, sp we shouldn't be writing tests in a
given we make a request to this endpoint with these query params, we expect this EXACT response
sort of style, right? Please feel free to correct me if I'm wrong on any of these assumptions, and thanks in advance! 🤗
To give an example of what I mean, say we have an endpoint
/user
which takes an
email
query parameter, our Pact test should just have a regex to ensure that the email is valid (standard email regex, perhaps a check on the domain for the email, etc.) and then ensure that the response contains the fields we would expect to see for the
user
object of the response, using things like `StringMatcher`s to ensure that a
username
has no special characters in it, etc. because the Android/iOS apps won't accept that, hence breaking the contract we expect. The Pact shouldn't do things like create a hardcoded case where, for example, the
email
query parameter is
<mailto:noaddressprovided@email.com|noaddressprovided@email.com>
and
willRespondWith
responds with a
user
object that has no address field in it, if I've understood correctly?
TL;DR: I suppose the question here is how generic/specific should the Pacts (and the tests we write by using them) be?
m
The reason there isn't much content is that there is nothing unique to the mobile use case.
💯 1
I believe there was an article that was recently released on mobile tho, let me find it
I'd start here tho: https://docs.pact.io/consumer I think that should answer your base questions
n
Hi Matt, Just popping on to say this is great. Bryen works with Barry (who wrote that article) and me at Go City 🙂