Meta tags:
description= Which @angular/* package(s) are the source of the bug? Don t known / other Is this a regression? No Description I m in the process of migrating from jasmine/karma with istanbul coverage to vitest with v8 coverage. I m currently migrating...;
Headings (most frequently used words):
commented, on, 2026, apr, the, mar, navigation, bug, please, provide, 14, description, metadata, footer, of, this, you, 24, daniemo2, martinspire, manojsridharsrinivasan, cexbrayat, v8, coverage, showing, unexpected, results, 32836, menu, repository, activity, issue, actions, which, angular, package, are, source, is, regression, link, to, minimal, reproduction, exception, or, error, saw, environment, discovered, in, run, ng, version, anything, else, skyzerozx, thepunderwoman, 25, 30, 10, emilycarter6561, byte, 11, 13, assignees, labels, type, projects, milestone, relationships, development,
Text of the page (most frequently used words):
the (82), #angular (53), this (32), and (32), coverage (31), 2026 (30), that (25), test (23), template (22), issue (21), with (21), github (16), apr (16), from (16), you (15), actions (15), for (15), cli (15), branch (15), component (14), more (13), mar (13), build (12), only (12), vitest (12), commented (11), but (10), are (10), app (9), triaged (9), gemini (9), fixture (9), tests (8), code (8), unit (7), function (7), class (7), compiled (7), setup (7), cexbrayat (7), mode (7), can (6), label (6), noting (6), has (6), been (6), comment (6), have (6), still (6), detectchanges (6), there (6), minimal (6), martinspire (6), core (6), bug (6), istanbul (6), 32836 (6), import (6), headercomponent (6), not (5), security (5), copilot (5), area (5), sign (5), real (5), remapped (5), also (5), because (5), case (5), manojsridharsrinivasan (5), your (5), run (5), daniemo2 (5), which (5), branches (4), one (4), added (4), 100 (4), here (4), spec (4), other (4), all (4), don (4), should (4), another (4), author (4), add (4), back (4), related (4), its (4), side (4), update (4), generated (4), compiler (4), project (4), showing (4), version (4), skyzerozx (4), link (4), true (4), cls (4), mockcomponent (4), search (4), new (4), support (4), time (3), navigation (3), open (3), needstriage (3), milestone (3), projects (3), reacted (3), react (3), typescript (3), goes (3), components (3), using (3), workaround (3), executed (3), want (3), exists (3), last (3), edited (3), repro (3), source (3), into (3), see (3), testing (3), shows (3), like (3), runs (3), create (3), our (3), against (3), thanks (3), left (3), signal (3), too (3), aot (3), default (3), something (3), router (3), files (3), uncovered (3), output (3), why (3), detection (3), makes (3), evaluate (3), false (3), both (3), covered (3), rather (3), than (3), 64583 (3), fixes (3), same (3), lines (3), thepunderwoman (3), reproduction (3), response (3), package (3), platform (3), browser (3), please (3), provide (3), config (3), testbed (3), imports (3), remove (3), selector (3), any (3), title (3), copy (3), unexpected (3), results (3), quality (3), tab (3), window (3), refresh (3), session (3), reload (3), developers (3), changelog (3), customer (3), enterprise (3), grade (3), features (3), share (2), community (2), status (2), footer (2), pull (2), requests (2), development (2), type (2), labels (2), metadata (2), hayley (2), price (2), maartje (2), kanaar (2), intentionally (2), what (2), seeing (2), use (2), known (2), jsdom (2), around (2), does (2), fix (2), when (2), html (2), issues (2), maybe (2), member (2), where (2), manoj (2), sridhar (2), srinivasan (2), some (2), ignore (2), simple (2), surprising (2), disclaimer (2), earlier (2), spent (2), way (2), much (2), digging (2), reason (2), creates (2), current (2), templates (2), app_template (2), ctx (2), ɵɵelement (2), outlet (2), inspect (2), dump (2), virtual (2), written (2), executes (2), creation (2), sees (2), taken (2), truthy (2), never (2), extra (2), ends (2), triggers (2), change (2), again (2), condition (2), pass (2), considers (2), sides (2), becomes (2), think (2), most (2), could (2), decide (2), special (2), example (2), excluding (2), done (2), signals (2), would (2), decision (2), email (2), unsubscribe (2), message (2), confirm (2), emilycarter6561 (2), byte (2), well (2), noticed (2), provider (2), repo (2), export (2), file (2), providers (2), robot (2), over (2), improvements (2), npm (2), environment (2), defineconfig (2), src (2), tsconfig (2), json (2), statements (2), functions (2), header (2), clsheadercomponent (2), tenantdropdowncomponent (2), util (2), searchcomponent (2), const (2), protected (2), ng21 (2), migrating (2), across (2), description (2), insights (2), 196 (2), repository (2), signed (2), universe (2), training (2), integrations (2), stories (2), center (2), documentation (2), learn (2), business (2), products (2), secret (2), perform, action, personal, information, manage, cookies, contact, docs, privacy, terms, inc, none, yet, relationships, due, date, assigned, assignees, already, account, join, conversation, free, removed, alan, agius4, daniel, morrison, rexsuecia, olivier, braud, user, perspective, effectively, present, avoid, blank, fake, overridden, line, fine, stays, below, cannot, reliably, pulls, custom, web, limitations, stack, practical, actual, override, behavior, assertions, these, tested, need, someone, take, look, bare, minimum, reproduce, know, few, workarounds, how, sourcemap, coming, running, popping, absolutely, perhaps, say, solution, detected, imagine, comments, then, nothing, necessarily, just, standard, whether, discussion, rarely, call, unnecessary, causes, state, insight, fri, cédric, exbrayat, wrote, reply, directly, view, receiving, subscribed, thread, https, com, notifications, auth, b7z2x6af47ju5ilzqfo6yn34vew5favcnfsm6aaaaacw7pofbovhi2dsmvqwix3lmv43oslton2wkq3pnvwwk3tuhm2demrvgyzdomzvg4, detailed, explanation, adding, sense, execution, via, tried, however, amount, less, definitely, lot, part, transferred, looks, move, apologies, own, previous, above, was, updated, quick, fixed, try, includes, 67339, contributor, ngbot, activity, rinckemd, andrew, gnagy, ron, olsen, nate, radebaugh, anything, else, node, manager, operating, system, darwin, arm64, installed, requested, animations, cdk, common, forms, language, service, dynamic, rxjs, zone, discovered, exception, error, saw, misconfigured, incorrect, assumption, globals, setupfiles, restoremocks, screenshotfailures, builder, options, browsers, chromium, buildtarget, admin, headless, runnerconfig, coverageinclude, coverageexclude, index, main, polyfills, routes, model, interface, coveragereporters, text, lcov, coveragethresholds, schedule, describe, beforeeach, async, await, configuretestingmodule, overridecomponent, tenant, dropdown, compilecomponents, createcomponent, return, componentinstance, debugelement, nativeelement, expect, tobetruthy, similar, render, variable, readonly, install, save, dev, application, even, empty, classes, show, process, jasmine, karma, currently, 2500, had, lower, mainly, regression, body, opened, items, dismiss, alert, switched, accounts, out, appearance, settings, pricing, event, talks, workshops, next, partners, about, company, forum, events, webinars, blog, resource, connect, resources, premium, advanced, ons, trust, industries, government, manufacturing, financial, services, healthcare, industry, nonprofits, startups, team, enterprises, stage, businesses, latest, place, developer, articles, sponsors, trending, repos, explore, customize, certifications, scanning, leak, prevention, protection, vulnerability, remediation, secure, cloud, environments, codespaces, analysis, enforcement, automation, ship, coding, agent, tasks, automated, work, hosting, review, collaboration, menu, skip, content,
Text of the page (random words):
v8 coverage showing unexpected results issue 32836 angular angular cli github skip to content navigation menu sign in products platform github repository hosting code review and collaboration copilot ai coding agent for tasks projects and automated work build ship actions ci cd and automation code quality quality analysis fixes and enforcement codespaces cloud development environments secure code security vulnerability detection and remediation secret protection secret scanning and leak prevention all features developers learn documentation training certifications build build with copilot customize copilot integrations explore trending repos github sponsors developer articles changelog changelog your source for the latest features improvements and fixes across github products all in one place businesses by stage enterprises team startups nonprofits by industry healthcare financial services manufacturing government see all industries evaluate github why github customer stories business insights trust center add ons github advanced security enterprise grade code security copilot for business enterprise grade ai features premium support enterprise grade 24 7 support resources learn connect documentation resource center blog events webinars community forum customer stories integrations support customer support training github status company about partners changelog github universe github universe the event for developers by developers talks workshops and what s next for github pricing search sign in sign up appearance settings you signed in with another tab or window reload to refresh your session you signed out in another tab or window reload to refresh your session you switched accounts on another tab or window reload to refresh your session dismiss alert message angular angular cli repository navigation code issues 196 196 pull requests 20 20 actions security and quality 8 8 insights more items v8 coverage showing unexpected results 32836 new issue copy link new issue copy link open open v8 coverage showing unexpected results 32836 copy link labels angular build unit test area angular build gemini triaged label noting that an issue has been triaged by gemini label noting that an issue has been triaged by gemini milestone needstriage description daniemo2 opened on mar 24 2026 issue body actions which angular package s are the source of the bug don t known other is this a regression no description i m in the process of migrating from jasmine karma with istanbul coverage to vitest with v8 coverage i m currently migrating around 2500 unit tests with istanbul i had over 95 coverage across statements branches functions and lines with vitest i m seeing lower coverage mainly on the branches with 90 i ve noticed that even empty classes template only show 90 branch coverage 9 10 a minimal reproduction create a new angular 21 application ng new ng21 install v8 coverage npm i save dev vitest coverage v8 remove the protected title variable from app ts protected readonly title signal ng21 remove the should render title test from app spec ts run ng test coverage this is the coverage i see similar from my project with the spec file as import testbed from angular core testing import headercomponent from header component import headercomponent as clsheadercomponent tenantdropdowncomponent from cls ui util import mockcomponent from cls ui util testing import searchcomponent from schedule components search search component describe headercomponent beforeeach async await testbed configuretestingmodule imports headercomponent providers overridecomponent headercomponent remove imports searchcomponent clsheadercomponent tenantdropdowncomponent add imports mockcomponent selector app search as any mockcomponent selector cls header as any mockcomponent selector cls tenant dropdown as any compilecomponents function setup const fixture testbed createcomponent headercomponent return fixture app fixture componentinstance compiled fixture debugelement nativeelement it should create the app const app setup expect app tobetruthy angular json test builder angular build unit test options browsers chromium buildtarget admin ui build headless true tsconfig tsconfig spec json runnerconfig vitest config ts coverage true coverageinclude src app ts coverageexclude index ts main ts polyfills ts routes ts model ts interface ts coveragereporters text html lcov coveragethresholds statements 90 branches 90 functions 90 lines 90 vitest config ts import defineconfig from vitest config export default defineconfig test environment jsdom globals true setupfiles src test setup ts restoremocks true coverage provider v8 browser screenshotfailures false have i misconfigured something do i have an incorrect assumption of v8 coverage or is there an issue here please provide a link to a minimal reproduction of the bug no response please provide the exception or error you saw please provide the environment you discovered this bug in run ng version angular cli 21 2 3 angular 21 2 5 node js 22 13 1 package manager npm 10 9 2 operating system darwin arm64 package installed version requested version angular animations 21 2 5 21 2 0 angular build 21 2 3 21 2 0 angular cdk 21 2 3 21 2 0 angular cli 21 2 3 21 2 0 angular common 21 2 5 21 2 0 angular compiler 21 2 5 21 2 0 angular compiler cli 21 2 5 21 2 0 angular core 21 2 5 21 2 0 angular forms 21 2 5 21 2 0 angular language service 21 2 5 21 2 0 angular platform browser 21 2 5 21 2 0 angular platform browser dynamic 21 2 5 21 2 0 angular router 21 2 5 21 2 0 rxjs 7 8 2 7 8 2 typescript 5 9 3 5 9 3 vitest 4 1 0 4 0 18 zone js 0 15 1 0 15 0 anything else no response react with 7 reacted by hayley price rinckemd andrew gnagy ron olsen manoj sridhar srinivasan nate radebaugh and maartje kanaar activity angular robot added gemini triaged label noting that an issue has been triaged by gemini label noting that an issue has been triaged by gemini on mar 24 2026 ngbot added this to the needstriage milestone on mar 24 2026 skyzerozx commented on mar 24 2026 skyzerozx on mar 24 2026 last edited by skyzerozx contributor more actions maybe this angular angular 67339 should be fixed there you can try it with angular 21 2 2 which includes that fix daniemo2 commented on mar 24 2026 daniemo2 on mar 24 2026 author more actions thanks for the quick response skyzerozx apologies i m using 21 2 5 for my own project the previous ng version output above was from the minimal reproduction i ve updated it no improvements with 21 2 5 thepunderwoman commented on mar 25 2026 thepunderwoman on mar 25 2026 more actions this looks to be a cli related issue i ll move this issue over to that repo thepunderwoman transferred this issue from angular angular on mar 25 2026 angular robot added area angular cli on mar 25 2026 martinspire commented on mar 30 2026 martinspire on mar 30 2026 last edited by martinspire more actions i can confirm this on my repo as well its on a lot of files on the export class part of the file but also on component providers however i also noticed this on the istanbul coverage provider not the same amount its less but there are still some lines showing to be uncovered which are definitely covered manojsridharsrinivasan commented on apr 6 2026 manojsridharsrinivasan on apr 6 2026 more actions i have the same issue with our project as well tried with v8 and istanbul both have same issue using angular 21 2 6 and vitest 4 1 1 cexbrayat commented on apr 10 2026 cexbrayat on apr 10 2026 member more actions here is a simple but surprising workaround add fixture detectchanges to the test and branch coverage goes back to 100 disclaimer i m the author of the earlier signal related coverage issue in core angular angular 64583 and i spent way too much time digging into this the reason is that this minimal repro only creates the component with the current ng test vitest setup tests run against aot compiled templates by default in this case the template is compiled to something like template function app_template rf ctx if rf 1 i0 ɵɵelement 0 router outlet you can inspect this with ng test dump virtual files in the test as written angular only executes the template in creation mode so v8 sees the if rf 1 branch taken only on its truthy side the template is never executed in update mode so the other side is left uncovered because this function only exists in generated output the coverage is remapped back to the component class which is why the class shows the extra branch and ends up at 9 10 if the test triggers change detection the template runs again in update mode that makes the rf 1 condition evaluate false on that pass so v8 considers both sides covered and branch coverage becomes 10 10 so i don t think this is a cli bug at most angular could decide to special case this in generated code for example by excluding that branch from coverage with an istanbul comment as done in signals but that would be a compiler core decision rather than a cli one emilycarter6561 byte commented on apr 11 2026 emilycarter6561 byte on apr 11 2026 via email more actions thanks for the detailed explanation cexbrayat i can confirm adding fixture detectchanges fixes the branch coverage in my project too makes sense that it s related to template execution in aot rather than a cli bug on fri apr 10 2026 12 41 pm cédric exbrayat wrote cexbrayat left a comment angular angular cli 32836 32836 comment here is a simple but surprising workaround add fixture detectchanges to the test and branch coverage goes back to 100 disclaimer i m the author of the earlier signal related coverage issue in core angular angular 64583 angular angular 64583 and i spent way too much time digging into this the reason is that this minimal repro only creates the component with the current ng test vitest setup tests run against aot compiled templates by default in this case the template is compiled to something like template function app_template rf ctx if rf 1 i0 ɵɵelement 0 router outlet you can inspect this with ng test dump virtual files in the test as written angular only executes the template in creation mode so v8 sees the if rf 1 branch taken only on its truthy side the template is never executed in update mode so the other side is left uncovered because this function only exists in generated output the coverage is remapped back to the component class which is why the class shows the extra branch and ends up at 9 10 if the test triggers change detection the template runs again in update mode that makes the rf 1 condition evaluate false on that pass so v8 considers both sides covered and branch coverage becomes 10 10 so i don t think this is a cli bug at most angular could decide to special case this in generated code for example by excluding that branch from coverage with an istanbul comment as done in signals but that would be a compiler core decision rather than a cli one reply to this email directly view it on github 32836 comment or unsubscribe https github com notifications unsubscribe auth b7z2x6af47ju5ilzqfo6yn34vew5favcnfsm6aaaaacw7pofbovhi2dsmvqwix3lmv43oslton2wkq3pnvwwk3tuhm2demrvgyzdomzvg4 you are receiving this because you are subscribed to this thread message id daniemo2 commented on apr 13 2026 daniemo2 on apr 13 2026 author more actions thanks for the insight cexbrayat in our unit tests we don t necessarily run tests against the template just our standard whether we should is another discussion and so we rarely call detectchanges as it s unnecessary for us and causes us to have setup component state perhaps like you say there s some solution where it s detected if a test runs in only create mode but as i imagine the ignore comments are compiled then it s a all or nothing ignore react with 1 reacted by manoj sridhar srinivasan martinspire commented on apr 14 2026 martinspire on apr 14 2026 more actions i also see this popping up on components where i absolutely do more testing but it still shows up cexbrayat commented on apr 14 2026 cexbrayat on apr 14 2026 member more actions martinspire you ll need to share a minimal repro if you want someone to take a look the bare minimum in your component and test to reproduce i know a few other workarounds and there are also issues in how the sourcemap are remapped to the source code that are coming from vitest v8 so maybe you running into that manojsridharsrinivasan commented on apr 14 2026 manojsridharsrinivasan on apr 14 2026 last edited by manojsridharsrinivasan more actions i tested this in my angular cli vitest setup and the issue still exists when the component test does not use the real template fixture detectchanges does fix the remapped branch function coverage when the actual component template is compiled and executed but in my case i intentionally override the template in the spec because i only want to unit test the typescript behavior and i do not want html template assertions in these tests i also cannot reliably use the real template here because it pulls in custom web components and there are known jsdom limitations around that stack so for this class of component tests using the real template is not a practical workaround what i am still seeing is real template fixture detectchanges branch coverage goes to 100 blank fake overridden template line coverage is fine but branch function coverage is still remapped to the component class and stays below 100 so from a user perspective the issue is still effectively present for typescript only component tests that intentionally avoid the real template react with 5 reacted by daniel morrison hayley price maartje kanaar rexsuecia and olivier braud alan agius4 added area angular build angular build unit test and removed area angular cli on apr 28 2026 sign up for free to join this conversation on github already have an account sign in to comment metadata metadata assignees no one assigned labels angular build unit test area angular build gemini triaged label noting that an issue has been triaged by gemini label noting that an issue has been triaged by gemini type no type projects no projects milestone needstriage no due date relationships none yet development no branches or pull requests issue actions open in github copilot app footer 2026 github inc footer navigation terms privacy security status community docs contact manage cookies do not share my personal information you can t perform that action at this time
|