To add TypeScript support to Cypress
npm i -D @bahmutov/add-typescript-to-cypress
- add tsconfig.json
- start using TypeScript in your cypress/integration/spec.ts
- you can write custom Cypress commands in TypeScript, see example in cypress/support/commands.ts to add custom commands.
- passing tests that exercise custom commands
- VSCode IntelliSense correctly shows
cy.foo()
docs
If you hit a problem, please open an issue either in this repo or in cypress-io/cypress with reproducible source code. The best issues are the ones we can "git clone ...", install dependencies and run to see the problem. This ensures we can fix it quicker.