vojvodics / vue3.3.1-jest-reproduction-example

Reproduction for vue bug

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Reproduction example for vue bug

Problem

When importing types in component, it fails in jest environment. To reproduce run:

npm run test

You should see an error:

    [@vue/compiler-sfc] No fs option provided to `compileScript` in non-Node environment. File system access is required for resolving imported types.

Solution

See vue3JestHack.js file.

In jest.config.js uncomment the transform option to use vue3JestHack, and run test again. You should see tests passing

About

Reproduction for vue bug


Languages

Language:Vue 73.1%Language:CSS 15.8%Language:TypeScript 4.9%Language:JavaScript 4.0%Language:HTML 2.1%