I am eager to determine the coverage of my project through my tests, and I am currently experimenting with the use of jest for this purpose.
Here is the content of my jest.config.js
:
module.exports = {
verbose: true,
preset: '@vue/cli-plugin-unit-jest',
transform: {
'^.+\\.vue$': 'vue-jest',
},
jest: {
coverageThreshold: {
global: {
branches: 50,
functions: 50,
lines: 50,
statements: 50,
},
'./src/components/': {
branches: 40,
statements: 40,
},
'./src/reducers/**/*.js': {
statements: 90,
},
'./src/api/very-important-module.js': {
branches: 100,
functions: 100,
lines: 100,
statements: 100,
},
},
},
}
However, upon trying to execute the command
jest --coverage --coverageReporters="json-summary"
I encountered the error: bash: jest: command not found
How can I resolve this issue?
Here are my devDependencies:
"eslint-plugin-vue": "^7.0.0",
"jest": "^27.5.0",
"jest-cli": "^27.5.0",