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.

Jest and TSX are not working

See original GitHub issue

Please, see https://github.com/vuejs/vue-cli/issues/6389 for details. Related to #77 and https://github.com/wonderful-panda/vue-tsx-support/commit/175cdf9a8a26e4369e874472a45eb7f5524ade00

In summary, we need CommonJS version. Workaround: add transformIgnorePatterns: [] to babel config

A proper fix is to change the vue-tsx-support package to provide both CommonJS and ES module entries, following the guide from the Node.js documentation: https://nodejs.org/api/packages.html#packages_conditional_exports

© @sodatea

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
wonderful-pandacommented, Jun 5, 2021

I just didn’t know multiple entry points can be exposed with both esmodule and commonjs.

Please confirm 3.2.0-beta.1 solves problem.

1reaction
wonderful-pandacommented, May 4, 2021

Sorry for the late response.

vue-tsx-support can’t provide multiple modules for now, because this exposes not only "vue-tsx-support" but also "vue-tsx-support/lib/{vca, modifiers}".

I’m planning to separate them into other packages, maybe within a month.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jest and TSX are not working · Issue #6389 · vuejs/vue-cli
FAIL tests/unit/example.spec.ts ○ Test suite failed to run Jest encountered an unexpected token This usually means that you are trying to ...
Read more >
Jest can't run test with methods in .tsx file
I solved it by adding an empty styleMock.ts file and adding it to moduleNameMapper on my jest.config.ts file. styleMock.ts
Read more >
Jest for a Typescript-based React app
I recently had to install and configure Jest in a React app written using ... Here, both tsx files and ts files will...
Read more >
Code Transformation
Jest runs the code in your project as JavaScript, but if you use some syntax not supported by Node out of the box...
Read more >
Setup | Testing Library
In these docs we'll demonstrate configuring Jest, but you should be able to do similar things with any testing framework (React Testing Library ......
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