const query = require('fs').readFileSync(`${__dirname}/MyQuery.graphql`, 'utf8');
describe('some test' () => {
it('should do something', async () => {
return request
.post('/graphql')
.send({ query, variables })
.expect(res => expect(res.body).toMatchSnapshot())
.expect(206);
});
});
// Some
// comments
I was able to confirm that the following works:
const query = require('fs').readFileSync(__dirname + '/MyQuery.graphql', 'utf8');
So the issue is with graphql + backtick.