Skip to content
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

Importing cypress-graphql-mock stops custom methods from being defined #12

Open
Nibblesh opened this issue Jul 17, 2019 · 0 comments
Open

Comments

@Nibblesh
Copy link

Nibblesh commented Jul 17, 2019

From using the typescript example recipe, adding the import statement for cypress-graphql-mock breaks the registration of new methods. File: https://github.com/cypress-io/cypress-example-recipes/blob/master/examples/preprocessors__typescript-webpack/cypress/support/commands.ts

I'm not able to use this module due to this feature being disabled. Rather than doing all of the cypress type registration and method adding in the imported file, this module could expose the type definitions and methods so that they can be bound in a declare namespace statement as per the recipe

Edit:

The commands.ts supplied in the example by cypress is an internal module, to work together with cypress-graphql-mock you need to move the commands.ts file elsewhere to allow it to remain as an internal module, and create a new commands.ts file which imports both cypress-graphql-mock and the moved commands.ts

// commands.ts
import 'cypress-graphql-mock';
import './custom-commands';

Maybe this should be noted in the read me for typescript users

@Nibblesh Nibblesh reopened this Jul 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant