Skip to content

Add next.js typescript example #315

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

Merged
merged 1 commit into from
Oct 9, 2020
Merged

Add next.js typescript example #315

merged 1 commit into from
Oct 9, 2020

Conversation

kylemh
Copy link
Contributor

@kylemh kylemh commented Oct 9, 2020

@CLAassistant
Copy link

CLAassistant commented Oct 9, 2020

CLA assistant check
All committers have signed the CLA.

@kylemh
Copy link
Contributor Author

kylemh commented Oct 9, 2020

The one thing I'd like help on and could not get working would be automatic path aliasing. Out of the box, Next.js TS has root-folder path aliases. Additionally, if I define any in the root tsconfig.json, I'd love for them to persist to Cypress.

Ignoring the feature request-y nature of the above. I couldn't get path aliases even explicitly working if they collided with a path alias from the root.

Copy link
Contributor

@bahmutov bahmutov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love this. You know what you could do in your example README - take a screenshot of the coverage report showing the filenames, similar to https://github.com/bahmutov/next-and-cypress-example#coverage

@bahmutov bahmutov merged commit 3e5a4a0 into cypress-io:master Oct 9, 2020
@kylemh
Copy link
Contributor Author

kylemh commented Oct 9, 2020

Any words on path aliases @bahmutov ? As it stands, I'd have to maintain path aliases in 3 different locations if I use Next/Cypress/Jest :(

@bahmutov
Copy link
Contributor

bahmutov commented Oct 9, 2020 via email

@kylemh
Copy link
Contributor Author

kylemh commented Oct 9, 2020

Done! Resolved a few small issues as well. Please note, I had no need for cypress/tsconfig.json!

I'l also willing and able to merge this in as a 1st-class solution if you'd like

@kylemh kylemh deleted the patch-1 branch October 9, 2020 21:45
@bahmutov
Copy link
Contributor

bahmutov commented Oct 9, 2020 via email

@kylemh
Copy link
Contributor Author

kylemh commented Oct 9, 2020

hahaha sorry.. i mean it doesn't have to be external (tied to my github account).

We could put into the official examples folder of this repo

@bahmutov
Copy link
Contributor

🎉 This PR is included in version 3.8.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants