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

Any ideas for supporting typescript/angular? #36

Closed
trfulcher opened this issue Sep 24, 2020 · 7 comments
Closed

Any ideas for supporting typescript/angular? #36

trfulcher opened this issue Sep 24, 2020 · 7 comments

Comments

@trfulcher
Copy link

Your project looks really cool. I have an angular app using cypress via the Nrwl.io setup, but I'm stuck running this. I did the installation as suggested then tried to workaround the absence of @types/cypress-audit by faking an index.d.ts declaration but when I run I still get


  src\support\index.ts

The error was:

Error: Webpack Compilation Error
E:/git/b2c/apps/appcheck-e2e/src/integration/app.spec.ts
ERROR in E:/git/b2c/apps/appcheck-e2e/src/integration/app.spec.ts(26,8):
TS2339: Property 'lighthouse' does not exist on type 'cy & EventEmitter'.

E:/git/b2c/apps/appcheck-e2e/src/integration/app.spec.ts
ERROR in E:/git/b2c/apps/appcheck-e2e/src/integration/app.spec.ts(27,8):
TS2339: Property 'pa11y' does not exist on type 'cy & EventEmitter'.

Any ideas?

Tim

@mfrachet
Copy link
Owner

Woops, looks I'm missing some d.ts files in the project :D. Will do! thanks for the interest 😊

@mfrachet
Copy link
Owner

mfrachet commented Sep 28, 2020

as a temporary workaround, you can cast it as any: (cy as any).lighthouse()

@snehalka
Copy link

@mfrachet I tried the temporary workaround mentioned above but it's running into a different issue.
Screenshot 2020-12-01 at 9 50 05 PM

@mfrachet
Copy link
Owner

Have you followed the 3 steps for the installation?

@connorbrez
Copy link

@mfrachet I am also having some issues using this on an angular project with the above work around, I added the commands to my own index.d.ts as well but the same issue occurred.

Screen Shot 2020-11-27 at 6 53 19 PM

@mfrachet
Copy link
Owner

IIRC, index.d.ts is a type definition file. I think that you may have to import it in the actual implementation command file.

Also, what you could do is to create an open source project showing this issue so that I can play with it and help you :)

@mfrachet
Copy link
Owner

v0.2.4 ships an index.d.ts file owning some declarations for typescript. Make sure to have:

/// <reference path="cypress-audit" />

at the top of your cypress tests and should be good to go :).

I'm closing the issue for now, feel free to reopen if you're in trouble :)

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

4 participants