Closed catkav closed 2 weeks ago
Did you update config.ts file ??
// cypress.config.ts
{
e2e: {
setupNodeEvents(on, config) {
cypressGrepPlugin(on, config);
on('task', {
grep(config) {
return cypressGrepPlugin(on, config);
},
});
return config; },
},
},
Please follow https://github.com/cypress-io/cypress/tree/develop/npm/grep#install
Did you update config.ts file ??
// cypress.config.js { e2e: { setupNodeEvents(on, config) { require('@cypress/grep/src/plugin')(config); return config; }, } }
Please follow https://github.com/cypress-io/cypress/tree/develop/npm/grep#install
Just tried there and still seeing the Typescript error
Try again, I have updated exact config for typescript, I would recommend to restart TS server
Tried again and restarted TS server (also tried restarting VSCode), but still seeing the error
@catkav I've had the same issue until I realized cypress grep was one major version behind. Please upgrade it to the latest version (it should be major version 4) and try again.
After the upgrade, just adding @cypress/grep
to the tsconfig solved the issue.
This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.
This issue has been closed due to inactivity.
Current behavior
When using grepTags in
it
block I'm seeing the following error:Argument of type '{ tags: string; }' is not assignable to parameter of type 'ProvidesCallback'. Object literal may only specify known properties, and 'tags' does not exist in type 'ProvidesCallback'.
I've added "@cypress/grep" to "types" in my tsconfig.json file and I've added
/// <reference types="@cypress/grep" />
to the top of my index.d.ts file like was suggested here https://github.com/cypress-io/cypress-grep/issues/166#issuecomment-1353558775Desired behavior
Currently I've added a comment to ignore the error
//@ts-expect-error TS(2345): Argument of type '{ tags: string; }' is not assignable to parameter of type 'ProvidesCallback'
However I want to tag a lot of tests and I don't want to have to comment them all, so looking for a way to resolve the errorAny help appreciated
Test code to reproduce
@cypress/grep version: 4.0.1
Cypress Version
12.17.2
Node version
v18.16.1
Operating System
macOS 13.6.1
Debug Logs
No response
Other
No response