Usage with Nuxt, Typescript and Jest
See original GitHub issueI’ve played with Cypress for the first time today and the first impression is great, thanks for all the work on this! That being said, while Cypress ran fine, the main app showed a lot of TS errors in build.
There are existing repositories that I look into for guidance:
- https://github.com/chymz/nuxt-starter - uses Nuxt, Jest, Cypress, but not TypeScript.
- https://github.com/cypress-io/cypress-and-jest-typescript-example - this one is promising but I didn’t manage to make it work like it. Maybe it’s Nuxt-TS that changes something.
- https://github.com/melrefaie/nuxt-cypress- Nuxt and Cypress, but no Jest and no TypeScript
Test code to reproduce
Minimal reproduction:
https://github.com/MartinMalinda/nuxt-jest-cypress-typescript
npx cypress open
works
npm run dev
errors out with type conflicts
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (5 by maintainers)
Top Results From Across the Web
Set up Nuxt3 with Jest & TypeScript | by Florian Gößler - Medium
Run Jest unit tests for single-file components, composables or any other JS/TS files · Write unit tests in TypeScript and have them properly...
Read more >thejones/nuxt-typescript-jest - GitHub
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may...
Read more >Testing | learn-nuxt-ts
Adding and configuring Jest. Following dependencies will be used: Jest. Our test runner. As we are using TypeScript, @types/jest is ...
Read more >Power a Nuxt application with TypeScript | by Alain Seng
Use TypeScript types ( number instead of Number , string instead of String , etc); Add / update types in JSDocs as well....
Read more >Jest encountered an unexpected token for NUXT typescript
after days and days research and debug, finally I resolved this issue by myself. referred to this blog ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I managed to get the build running.
I did these two things:
extend
from thetsconfig.json
in cypress folder - I guess the extend merged thetypes
, not overrode it and that caused the conflictscypress
to exclude in the roottsconfig.json
I’ll try run tests, use TS etc to check if this solves everything.
Closing as resolved.
If you’re experiencing a bug similar to this in Cypress, please open a new issue with a fully reproducible example that we can run. There may be a specific edge case with the issue that we need more detail to fix.