I am have installed ESlint in out test project and it started to show me few errors that i need to resolve
one of the error is in cy.request('someURL');
The error is cy is undefined
so I have added a import statement on top of file like this
import { cy } from 'cypress';
After adding this statement none of the requests are going through I am getting this error when i try executing the tests.
Tests are executing perfects once i remove the import statement
where am i going wrong
cy
is a global variable. Much like location
. So really it is window.cy
. You can add it to the globals in Eslint. Don't import cy
from cypress.
{
"globals": {
"cy": true
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With