-
-
Notifications
You must be signed in to change notification settings - Fork 89
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
[Feature] Update the readme with instructions on how to add the attachFile command to typescript intellisense #202
Comments
Would help a lot. |
Hi @UncleGus @MCFreddie777 did you have a chance to check #167
|
@abramenal I just posted (#167 (comment)) in that issue (which I think can be closed if the solution works for people). I'd be happy to make a small PR outlining how to add the Let me know what you think! |
Hi @peterkrieg |
Update: Previously I used typeRoots in my project, so I tried to add it there: // /cypress/tsconfig.json
"typeRoots": [
"../node_modules/@types",
"../node_modules/cypress/types",
"../types",
"../node_modules/cypress-file-upload"
] Using this solution, my IDE (WebStorm) stopped complaining about not existing property, but when I ran the tests, I started getting errors such as Maybe its worth to mention that I'm running cypress@4.12.1 but without out-of-the-box typescript, still using Well, I started trying more solutions as adding "../node_modules/cypress-file-upload/types" into the The only solution that worked is: // /cypress/tsconfig.json
"types": ["cypress", "cypress-file-upload"],
"typeRoots": [
"../node_modules/@types",
"../types"
] You can use both |
This worked for me straight away, I'm surprised that this is not documented in the README. |
I think README indeed lacks of clarity on using command with TS, might be a good improvement for upcoming v5 release. |
I whipped up a super quick MR to include @MCFreddie777 's .tsconfig changes to the README, you can find it here: #246 |
Current behavior:
When using the
.attachFile()
command, intellisense doesn't recognise it and underlines it red.Desired behavior:
Intellisense should recognise the command. This can be achieved by adding the command to
index.d.ts
in thecypress/support
folder. More details in the Cypess custom commands documentation.Versions
N/A
The text was updated successfully, but these errors were encountered: