Skip to content
This repository has been archived by the owner on May 24, 2021. It is now read-only.

fyi - using plugin with typescript support index.ts #70

Open
craigryan opened this issue Aug 1, 2020 · 0 comments
Open

fyi - using plugin with typescript support index.ts #70

craigryan opened this issue Aug 1, 2020 · 0 comments

Comments

@craigryan
Copy link

craigryan commented Aug 1, 2020

We have an nx monorepo with apps/proj-e2e directory. Cypress is set up with plugins/index.js and require('cypress-plugin-retries/lib/plugin')(on) as required. However, the support files were setup with typescript - index.ts, app.po.ts etc. Trying this:

require('cypress-plugin-retries');

Failed when running a single spec (ie: ng run proj-e2e:e2e --spec...) with the error
TS2339: Property 'currentTest' does not exist on type 'Cypress & EventEmitter'

To get the plugin to work with both running single specs (headless) and also via the cypress app I made a simple change to import the plugin instead and its all good:

// Import commands.js using ES2015 syntax:
import './commands';
import 'cypress-plugin-retries';

hope this helps.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant