nx icon indicating copy to clipboard operation
nx copied to clipboard

Cypress component testing "Property 'myCommand' does not exist on type 'cy & CyEventEmitter'"

Open yjaaidi opened this issue 3 years ago • 0 comments

Current Behavior

When using Cypress component testing generator, command types are not detected causing "Property 'myCommand' does not exist on type 'cy & CyEventEmitter'" error.

Expected Behavior

Command types defined in ${projectRoot}/cypress/support/**/*.ts should be detected.

Steps to Reproduce

  1. nx g @nrwl/angular:cypress-component-configuration --project app
  2. Add the following to cypress/support/commands.ts:
import { mount } from 'cypress/angular';

declare global {
  namespace Cypress {
    interface Chainable<Subject> {
      mount: typeof mount;
    }
  }
}

Cypress.Commands.add('mount', mount);
  1. Add test example.cy.ts
  2. Call cy.mount()

Environment

   Node : 18.3.0
   OS   : darwin x64
   yarn : 3.2.3
   
   nx : 14.7.8
   @nrwl/angular : 14.7.8
   @nrwl/cypress : 14.7.8
   @nrwl/detox : Not Found
   @nrwl/devkit : 14.7.8
   @nrwl/eslint-plugin-nx : 14.7.8
   @nrwl/expo : Not Found
   @nrwl/express : Not Found
   @nrwl/jest : 14.7.8
   @nrwl/js : 14.7.8
   @nrwl/linter : 14.7.8
   @nrwl/nest : Not Found
   @nrwl/next : Not Found
   @nrwl/node : 14.7.8
   @nrwl/nx-cloud : Not Found
   @nrwl/nx-plugin : Not Found
   @nrwl/react : Not Found
   @nrwl/react-native : Not Found
   @nrwl/schematics : Not Found
   @nrwl/storybook : 14.7.8
   @nrwl/web : Not Found
   @nrwl/workspace : 14.7.8
   typescript : 4.7.4
   ---------------------------------------
   Local workspace plugins:
   ---------------------------------------
   Community plugins:
         @jscutlery/cypress-angular: 0.9.22
         @testing-library/angular: 11.0.4

yjaaidi avatar Sep 21 '22 11:09 yjaaidi