Last 12 weeks · 0 commits
3 of 6 standards met
Reproduction repository: https://github.com/mschwebler-tgm/vue-jest-reproduction-example Problem description Given we import a TS type, When we use that type in vue's API, We get an error when running the unit tests: Node: 18.20.4 npm: 10.7.0 jest: 29.7.0 vue: 3.4.38 @vue/vue3-jest: 29.2.6 Details The error occurs when we import TS types and use them in Vue's API functions (defineProps, defineEmits, etc...) The error does not occur when the type is used for anything else For commonjs projects a workaround exists here - this does not work for ESM module projects Steps to reproduce 1) Clone the repository 2) Install dependencies 3) Run tests
When upgrading to TypeScript 6.0 it does not seem to be enough anymore to transpile the section via TypeScript as the output will contain ESM statements, which are incompatible with standard Jest at this point. Thus, this PR proposes to always tun babel on the TypeScript output to generate Jest-compatible CommonJS syntax.
Repository: vuejs/vue-jest. Description: Jest Vue transformer Stars: 751, Forks: 159. Primary language: JavaScript. Languages: JavaScript (73%), Vue (23.7%), TypeScript (2.1%), SCSS (0.4%), Less (0.3%). License: MIT. Topics: jest, jest-vue, vue-jest. Latest release: v29.2.6 (2y ago). Open PRs: 14, open issues: 124. Last activity: 2y ago. Community health: 37%. Top contributors: eddyerburgh, lmiller1990, nogic1008, dependabot[bot], JessicaSachs, cexbrayat, sibiraj-s, yyx990803, jolting, jeremyzahner and others.