-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Examples using fs.readFileSync #5
Comments
Ah this was my confusion. Didn't realize this was being called in // cypress/plugins.index.js
const cucumber = require('cypress-cucumber-preprocessor').default
const fs = require('fs');
const graphQlSchema = fs.readFileSync('schema.graphql', 'utf8');
module.exports = (on, config) => {
on('file:preprocessor', cucumber())
config.env.GRAPHQL_SCHEMA = graphQlSchema;
return config;
} then in my tests: // cypress/.../steps.js
beforeEach(() => {
cy.server();
cy.mockGraphql({ schema: Cypress.env('GRAPHQL_SCHEMA') });
}); |
@zhammer why are you using |
just by chance on my project I'm using https://github.com/TheBrainFamily/cypress-cucumber-preprocessor. But not necessary for this example. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Are there any examples of using this plugin with
fs.readFileSync
? I'd prefer to read in the graphql schema than import a json introspection query.The text was updated successfully, but these errors were encountered: