cypress-io / cypress-grep

Filter tests using substring
137 stars 19 forks source link

typescript is always return error about the tags object if we don't add //@ts-ignore #166

Closed idanElitzur closed 1 year ago

idanElitzur commented 1 year ago

Intellj always return a typescript error about the object of tags even it's defined as "type" inside the typescript compiler configurat file and also is part of the "include" files. please your assistance.

Screenshot 2022-12-05 at 12 16 01

alexandreedgeiq commented 1 year ago

I'm experiencing the same issue with .ts files. Cypress: 11.2.0 "cypress-grep": 3.1.0

But I found a solution to this issue. In my e2e.ts I used: require('@cypress/grep')(); And in my tsconfig.json inside Types, I included "@cypress/grep"

image

Kosai106 commented 1 year ago

As @alexandreedgeiq pointed out, you need to:

  1. Update to the latest version

  2. Add @cypress/grep to your tsconfig.json

  3. add the following to the top of your commands.d.ts file:

/// <reference types="@cypress/grep" />;
richardszanyi-kasa commented 1 year ago

As @alexandreedgeiq pointed out, you need to:

  1. Update to the latest version
  2. Add @cypress/grep to your tsconfig.json
  3. add the following to the top of your commands.d.ts file:
/// <reference types="@cypress/grep" />;

Where can we find this command.d.ts file? I only got support/commands.ts

Kosai106 commented 1 year ago

@richardszanyi-kasa https://docs.cypress.io/guides/tooling/typescript-support#Using-an-External-Typings-File

idanElitzur commented 1 year ago

Thanks for your answer. I've already try all of these ways but something wrong with this package.

richardszanyi-kasa commented 1 year ago

@Kosai106 image

It throws me an error like that.

Cypress v11.3.0