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

149
Views
Jest configuration for sub-projects

I have a Angular project that is divided in sub-projects, and I'm testing it with jest. The configuration is done in a jest.config.js file and this configuration is exported as module.exports, so when I call test for this project all the tests in the sub-projects are ran.

The problem is that I want some configuration to be of only a sub-project, there is a way to have a jest.config.js in these sub-projects?

For example:

./jest.config.js:

const { compilerOptions } = require('./tsconfig');

module.exports = {
  preset: 'jest-preset-angular',
  roots: [
    '<rootDir>/project1/src/',
    '<rootDir>/project2/src/',
  ],
  testMatch: ['**/+(*.)+(spec).+(ts)'],
  collectCoverage: true,
  coverageReporters: ['text-summary'],
};

./project1/jest.config.js:

const { compilerOptions } = require('./tsconfig');

module.exports = {
  coveragePathIgnorePatterns: ['./project1/src/models'],
};

In this case the configuration for ignoring sem path in coverage would take value only in the project1 directory.

about 4 years ago · Juan Pablo Isaza
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!