Jest and TSX are not working
See original GitHub issuePlease, 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:
- Created 2 years ago
- Comments:5 (4 by maintainers)
Top 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 >
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 Free
Top 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
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.
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.