Wellington Aquino
02/08/2022, 2:04 PMTaylor King
08/17/2022, 10:06 PMTaylor King
08/29/2022, 6:05 PM.given()
does work, but it also creates two interactions for the same test apparently adding the given() call to my interaction. I don't know if having both uponReceiving and given in one interaction is creating those two tests, but based on the type defs of uponReceiving that wouldn't make sense to me.Maxim Filimonov
09/13/2022, 10:11 AMuseQuery
hooks with Pact?
The only working one I found so far is to write component tests and that does mean that we are tying pact to our UI implementation. Trying to make pact covered layer as close as possible to the direct http calls.Taylor King
09/20/2022, 9:17 PMnew GraphQLInteraction()
.......
.willRespondWith({
status: 200,
headers: {
'Content-Type': 'application/json',
},
body: {
data: {
addTime: {
updatedRecord: {
id: like('62edadccafea8bf4d0d17bbd'),
currentTime: like(40),
},
},
},
},
});
Calling then a mocked Pact server, I am essentially testing that the response would also equal that response defined in the GraphQLInteraction ... so when would my expectation within the test file itself actually fail other than me intentionally (or unintentionally) not writing correctly the object to match against the response. Seems like even the unintentional failure would be more prohibitive than beneficial.
Totally could be misunderstanding the whole point (it's actually highly likely) ... but just wanted further documentation to unfuzzy this concept, and/or community discussion to help bridge this understanding in my head. Seems like, as I'm typing this, this would be more broad than just GraphQL itself and maybe it's a concept higher above I'm just not yet grasping, so would 1,000% love some insight and guidance to this scenario.Jay Wang
02/01/2023, 10:58 PMMatt (pactflow.io / pact-js / pact-go)
Jay Wang
02/03/2023, 5:01 PMMankirat Gulati
05/12/2023, 5:24 PMMatt (pactflow.io / pact-js / pact-go)
Vijaya Balla (External)
07/21/2023, 3:11 PMYousaf Nabi (pactflow.io)
Bas Dijkstra
08/10/2023, 9:42 AMJoel Whalen
10/06/2023, 5:13 PMserver.printHandlers()
looks like this:
console.log
[graphql] query userAndInviteInfo (origin: *)
Declaration: /Users/joel.whalen/Documents/src/frontend-core/.yarn/__virtual__/@updater-consumer-graph-virtual-1670450a42/1/packages/consumer-graph/dist/cjs/mocks.js:1113:64
but I’m getting a pact msw error that says it cannot find any graphql handlers:
● useIsMoveUPO › returns true if the invite is marked as residentOnboaringEnabled
Found errors on msw requests.
Requests with missing msw handlers:
<http://localhost:3000/graphql>
56 | });
57 | afterEach(() => {
> 58 | pactMswAdapter.verifyTest();
| ^
59 | server.resetHandlers();
60 | });
61 | afterAll(async () => {
I’m setting up my MSW handlers like this:
const handlers = [
mockUserAndInviteInfoQuery((req, res, ctx) => {
console.log(`Request: ${req}`);
console.log(ctx.data);
return res(
ctx.data({
getUser: {
user,
},
inviteByToken: {
invite,
},
})
);
}),
];
const server = setupServer(...handlers);
so I’m wondering if I’m doing something wrong, since pact msw can’t see it. Thoughts?Joel Whalen
10/06/2023, 5:35 PMproviders
attribute work, since all providers are “hidden” by the /graphql
endpoint?