Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
cypress/test/test.spec.js
describe('query: GetFoobar()', () => {
const GetFoobar = (foo, bar) => `{
foo(foo: ${foo}, bar: ${bar}) {
id
foobar {
foo
bar
}
}
}`;
const foo = 'foo';
const bar = 'bar';
let responseData;
before(() => {
cy.postGQL(authToken, GetFoobar(foo, bar)).then(
res => (responseData = res.body.data),
);
});
it('returns foobar', () => {
assert.isObject(responseData.foobar);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment