cypress-documentation icon indicating copy to clipboard operation
cypress-documentation copied to clipboard

Typescript for >=v10

Open melibe23 opened this issue 2 years ago • 2 comments

Subject

Guidelines

Description

I only see reference for <10 version of Cypress here, https://docs.cypress.io/guides/tooling/typescript-support#Types-for-custom-commands, is written someplace else?

melibe23 avatar May 21 '23 14:05 melibe23

@elylucas

Some comments from my side:

The default file listed in Cypress Legacy configuration is index.js (TypeScript is not mentioned). This is the filename being used in https://docs.cypress.io/guides/tooling/typescript-support#Types-for-custom-commands.

In Cypress current configuration the default e2e support file is cypress/support/e2e.{js,jsx,ts,tsx} and for component testing cypress/support/component.js (no mention of TypeScript).

In Examples

  • the TS example is labelled "Adding Custom Commands (TS)", so add "(TS)" to the reference
  • https://github.com/omerose/cypress-support is based on Cypress 3.6.0 before full TypeScript support was added to Cypress. It uses the obsolete "@bahmutov/add-typescript-to-cypress": "2.1.2". This example should be removed.

In Clashing types with Jest

  • the repo https://github.com/cypress-io/cypress-and-jest-typescript-example uses the legacy Cypress version 6.8.0 and the repo has been archived, so probably it should be removed.
  • the repo https://github.com/bahmutov/local-cypress uses the legacy Cypress version 9.7.0. Its ci workflow is broken and needs work done on it to enable it to work with currently supported mechanisms on GitHub. I'm not sure how helpful this one is.

MikeMcC399 avatar May 24 '23 17:05 MikeMcC399

  • This open issue is still relevant. PR https://github.com/cypress-io/cypress-documentation/pull/5640 made a correction but could not attempt the missing migration of the document page Tooling > TypeScript to correctly describe TypeScript setup for non-legacy Cypress versions 10.x and higher.

MikeMcC399 avatar Feb 12 '24 14:02 MikeMcC399