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

300
Views
What happens to unit tests and e2e tests in production Angular builds?

Let's say I'm running default production build settings in angular.json. What happens to all of my unit test and e2e test files (Protractor OR Cypress) when I run npm build --prod? Are these files included in the final build within the dist folder, or are they excluded to reduce bundle size? Is this inclusion or exclusion of test files in production builds configurable?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Angular has in its prod build process procedures called "tree-shaking" and, "dead-code elimination". Any code that is not in use by the angular prod app and/or its dependencies is removed from the built code.

This answer provides good details on how it works for angular builds

tl;dr;

If your object/function/class (test or not) is referenced by your components/modules/services/(and other angular blocks or other js/ts code dependencies) it is almost certain to remain into the built app. All other code is removed from the built app.

if you want some code from test files to remain in the built files, you will need to reference that file's exported objects/function from your js files and use that reference somehow.

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!