bencodezen / vue-enterprise-boilerplate

An ever-evolving, very opinionated architecture and dev environment for new Vue SPA projects using Vue CLI.
7.77k stars 1.32k forks source link

Error in test unit. something wrong with config, maybe #219

Closed impeiran closed 1 month ago

impeiran commented 3 years ago

the following's can reappear in: https://github.com/impeiran/vue-enterprise-boilerplate

  1. jest doesnt support webpack's API: require.context, and then it occurs the error image i found a solution to resolve it. from: https://stackoverflow.com/questions/38332094/how-can-i-mock-webpacks-require-context-in-jest/54151648#54151648

  2. after solving the first problem, it comes the second: imported module but undefined, i have no idea to fix it, and im pretty sure the path and the babel config are fine. image

beamsies commented 3 years ago

I'm having the same issue.

I don't know how to mock this as I'm new to unit testing in Jest.