Skip to content
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

Specs generated from Storybook use .tsx in import path which is disallowed by the TS compiler #21736

Closed
sync-by-unito bot opened this issue May 30, 2022 · 2 comments
Labels
CT Issue related to component testing type: bug

Comments

@sync-by-unito
Copy link

sync-by-unito bot commented May 30, 2022

When you go through the migration process & choose to create a spec from a Storybook story, the generated file has the line:

import * as stories from "./MyStoryFile.stories.tsx"

This causes the TypeScript compiler/linter to complain:

An import path cannot end with a '.tsx' extension. Consider importing './MyStoryFile.stories.js' instead.ts(2691)

{panel:bgColor=#deebff}
Discussion of this TS limitation here: microsoft/TypeScript#27481
{panel}

┆Issue is synchronized with this Jira Bug by Unito
┆author: Matthew Simpson
┆epic: CT API related issues
┆friendlyId: UNIFY-1132
┆priority: Low
┆sprint: Unification Release Backlog
┆taskType: Bug

@sync-by-unito sync-by-unito bot added CT Issue related to component testing epic:ct-api-issues type: bug labels May 30, 2022
@sync-by-unito
Copy link
Author

sync-by-unito bot commented May 30, 2022

➤ Zach Williams commented:

The only files that should include the extension are vue files. Looks to be a regression from #19862 ( https://github.com/cypress-io/cypress/pull/19862|smart-link )

@ZachJW34
Copy link
Contributor

ZachJW34 commented Oct 6, 2022

Create from Storybook component was removed in 10.0

@ZachJW34 ZachJW34 closed this as completed Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CT Issue related to component testing type: bug
Projects
None yet
Development

No branches or pull requests

1 participant