Skip to content

Support TypeScript support and plugin files #7459

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
amirrustam opened this issue May 22, 2020 · 4 comments · Fixed by #7463
Closed

Support TypeScript support and plugin files #7459

amirrustam opened this issue May 22, 2020 · 4 comments · Fixed by #7463
Assignees
Labels
topic: typescript type: regression A bug that didn't appear until a specific Cy version release v4.6.0 🐛 Issue present since 4.6.0

Comments

@amirrustam
Copy link
Contributor

Current behavior:

TypeScript support files (i.e support/commands.ts) and plugin file (plugins/index.ts) cause tasks and/or custom commands to not be found/registered. For example, the custom task db:seed could not be registered within the cypress-realworld-app project:

Screen Shot 2020-05-20 at 3 12 52 PM

Converting the plugins file back to JavaScript resolved the issue, but a similar issue also exists for a commands.ts, which resulted in custom commands not being added:

Screen Shot 2020-05-20 at 5 36 17 PM

Converting the support files back to JavaScript also resolved the issue.

It should be noted that this issue did not exist with Cypress develop branch before and after the v4.6 release.

Desired behavior:

  • TypeScript support and plugin files to be properly loaded and/or executed for test execution.
  • Customs commands should be added and tasks should be registered when declared in TS files.

Test code to reproduce

Reproduction (with associated commit) can be seen within this cypress-realworld-app test run: https://dashboard.cypress.io/projects/7s5okt/runs/1272/specs

Versions

Cypress v4.6

@amirrustam amirrustam added the v4.6.0 🐛 Issue present since 4.6.0 label May 22, 2020
@jennifer-shehane jennifer-shehane added topic: typescript type: regression A bug that didn't appear until a specific Cy version release labels May 22, 2020
@cypress-bot cypress-bot bot added the stage: needs investigating Someone from Cypress needs to look at this label May 22, 2020
@bahmutov
Copy link
Contributor

Confirmed in https://github.com/bahmutov/test-ts-plugins

Workaround: point at plugins and support TS files explicitly from cypress.json file

{
  "pluginsFile": "cypress/plugins/index.ts",
  "supportFile": "cypress/support/index.ts"
}

@bahmutov bahmutov self-assigned this May 22, 2020
@amirrustam
Copy link
Contributor Author

@bahmutov I can confirm your workaround worked.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented May 27, 2020

The code for this is done in cypress-io/cypress#7463, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot cypress-bot bot removed the stage: needs review The PR code is done & tested, needs review label May 27, 2020
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jun 8, 2020

Released in 4.8.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v4.8.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Jun 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
topic: typescript type: regression A bug that didn't appear until a specific Cy version release v4.6.0 🐛 Issue present since 4.6.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants