question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Document how Next and ts-jest coexist

See original GitHub issue

Feature request

Is your feature request related to a problem? Please describe.

From https://github.com/zeit/next.js/issues/3663#issuecomment-385361537 and https://github.com/zeit/next.js/issues/8663, it looks like no single value for the tsconfig’s compilerOptions.jsx works for both Next.js (which requires "preserve") and Jest (which requires "react"). Those issues suggest configuring ts-jest to use a separate tsconfig.jest.json, but their guidance hasn’t made it into any actual documentation that I can find.

Describe the solution you’d like

Write a page in https://nextjs.org/docs/ saying how to get started testing.

Describe alternatives you’ve considered

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
jyasskincommented, Apr 25, 2020

I tried the with-jest example, introduced a type error, and neither npm test nor npm run build failed. A type error did cause npm test to fail when I followed the linked issues’ advice.

Even if with-jest did work for typescript, an example isn’t a complete substitute for a documentation page that describes how you intend folks to test their projects.

2reactions
Timercommented, Jul 22, 2020

Closing per above and that we allow module: 'commonjs' on next@canary!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Setting up Jest and Enzyme for Typescript Next.js apps
js + Typescript setup using ts-jest. This is one of these post: explaining how to glue pieces together and humbly describes ...
Read more >
How to Setup Next.js + TypeScript + Eslint + Storybook + Jest ...
js project! Next, create a tsconfig.json file with the following command: touch tsconfig.json. Install some TypeScript dependencies:
Read more >
Setting up a project with jest in TypeScript. - ITNEXT
A step by step process of creating a project in TypeScript and setting up a test environment with jest using Visual Studio Code....
Read more >
How to configure Jest with TypeScript | Swizec Teller
Making Jest and TypeScript work together smoothly is something you do ... For the initial setup we can use ts-jest's install documentation.
Read more >
Configuring Jest
The configuration also can be stored in a JSON file as a plain object: ... The babel and v8 coverage providers use /*...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found