find-cypress-specs icon indicating copy to clipboard operation
find-cypress-specs copied to clipboard

Problem parsing file

Open danrealednb opened this issue 2 years ago • 1 comments

Any spec file that I have (all typescript files. .spec.ts) have tags like so, where the tag is a typescript enum:

import { TAGS } from '../../../support/tags'
describe('Account Detail', { tags: [TAGS.ADMIN] }, () => {})

The tags are an import from a typescript enum.

export enum TAGS {
  SMOKE = '@smoke',
  ADMIN = '@admin',
}

When I run npx find-cypress-specs --names I get this error. find-cypress-specs: problem parsing file cypress/e2e/e2e/Admin/Admin.spec.ts

I'm assuming this is because of the way I am using the enum as a tag. A string works. Is this a bug that can be fixed, or do I need to take an alternative approach?

Thanks!

danrealednb avatar Mar 13 '23 21:03 danrealednb

Well, this is very hard to fix, since the value of the tag is pretty hard to know when just parsing the tests, right?

bahmutov avatar Mar 28 '23 17:03 bahmutov