I am trying to do a unit test by following the official guide by cloning the demo repository vue-test-utils-getting-started
.
Step to Reproduce
- npm install (only run once after cloning vue-test-utils-getting-started)
- Because the file is prepared, run
npm test
could see the following error
● Validation Error:
Preset @vue/cli-plugin-unit-jest/presets/no-babel/jest-preset.js not found.
Configuration Documentation:
https://facebook.github.io/jest/docs/configuration.html
If cat the file
cat @vue/cli-plugin-unit-jest/presets/no-babel/jest-preset.js
it does display the content meaning that the file does exist in the path
If comment out the line, it works. It seems that the mechanism to load the preset file is buggy. Does any one know how to load the preset correctly?
// jest.config.js
module.exports = {
// this is installed by default, but not working, many people encounters, "not found" but file exists
// preset: '@vue/cli-plugin-unit-jest/presets/no-babel'
}