vuejs / vue-jest

Jest Vue transformer
MIT License
746 stars 157 forks source link

How to load a custom babel config for vue-jest in Node #528

Open Jinjiang opened 1 year ago

Jinjiang commented 1 year ago

The background is I was trying to run some tests with jest in Node (without any shell scripts or rc files). However, I didn't find a way for vue-jest to load a custom babel config. Is there any (special) way to achieve this?

Here is a simple reproduction (vue3) that causes a transform error: https://github.com/Jinjiang/try-jest/tree/custom-babel-config

And based on the reproduction repo, if you move the config/babel.config.js to the root dir, then the transform would be back to succeed.

Thanks.