cypress-documentation
cypress-documentation copied to clipboard
Typescript for >=v10
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?
@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.
- the repo https://github.com/cypress-io/cypress-and-jest-typescript-example uses the legacy Cypress version
6.8.0and 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.
- 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.xand higher.