bahmutov / find-cypress-specs

Find Cypress spec files using the config settings
38 stars 12 forks source link

Problem parsing file #119

Open danrealednb opened 1 year ago

danrealednb commented 1 year ago

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!

bahmutov commented 1 year ago

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