@cypress/grep TS linter displays errors when using tags in "describe" but not "it"
See original GitHub issueCurrent behavior
As per the docs we have added the types to the tsconfig.json file like so:
"types": ["cypress", "@cypress/grep", "node"],
However, when using the tags in describe blocks, the Typescript linter displays errors e.g:
describe('Test file', { tags: ['@tag1', '@tag2'] }, () => {
Argument of type ‘{ tags: string[]; }’ is not assignable to parameter of type ‘SuiteConfigOverrides’.
Object literal may only specify known properties, and ‘tags’ does not exist in type ‘SuiteConfigOverrides’.
No errors are displayed when using them with “it” e.g:
it('Test file', { tags: ['@tag1', '@tag2'] }, () => {
We can use //@ts-ignore
to remove these but it is not ideal and the previous ‘cypress-grep’ package did not have these issues.
Desired behavior
No errors should be shown regardless of whether you use describe or it
Test code to reproduce
tsconfig.json:
{
"compilerOptions": {
"target": "es5",
"lib": ["es5", "dom"],
"types": ["cypress", "@cypress/grep", "node"],
"resolveJsonModule": true
},
"include": ["**/*.ts"]
}
spec file:
describe('Test file', { tags: ['@tag1', '@tag2'] }, () => {})
Cypress Version
11.2.0
Node version
v16.14.2
Operating System
macOS 12.2.1, Windows 10
Debug Logs
No response
Other
No response
Issue Analytics
- State:
- Created 10 months ago
- Reactions:7
- Comments:7
Top GitHub Comments
Add the following before the
describe
orcontext
in ts tests, it will suppress the error:Do we have a work around for this issue. I am facing the same issue in cypress 11.2 version with “@cypress/grep”: “^3.1.0”,