tgriesser/cypress-graphql-mock

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

Nibblesh opened this issue · 0 comments

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