-
Hi Is there any way to get it working with supertest? Any help appreciated 🙏🏼 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 9 replies
-
You can just pass the Yoga instance to the supertest just like an express instance. |
Beta Was this translation helpful? Give feedback.
-
Yes, I am aware of that, not sure how it worked either 😀 it('should return an account', async () => {
const query = `
query getSingleAccount($id: Int!) {
account(id: $id) {
foo
}
}`;
const params = {
query: query,
variables: {
id: account.id,
},
}
const res = await request(app)
.get('/graphql')
.set('Authorization', authHeader)
.send(params)
.expect('Content-Type', /json/)
.expect(200);
const result = res.body.data.account;
expect(result.id).to.equal(1000);
expect(result.description).to.equal('foo bar');
});
}); anyhow, it is working, for now at least :) |
Beta Was this translation helpful? Give feedback.
Yes, I am aware of that, not sure how it worked either 😀
But the codebase had these tests everywhere and none of them failed until I migrated to Yoga :