Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

264
Views
How can I know what percentage is covered by my tests?

I want to know how much of my project is covered by my tests, and I am currently trying to use jest to do so.

This is 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,
      },
    },
  },
}

But when I tried to run the command jest --coverage --coverageReporters="json-summary"

I get the error: bash: jest: command not found How do I solve this error?

my devDependecies are:

 "eslint-plugin-vue": "^7.0.0",
    "jest": "^27.5.0",
    "jest-cli": "^27.5.0",
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Your error is

bash: jest: command not found

Which means jest isn't added to your project/installed. Install it with: npm install --save-dev jest.

More information about jest

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!