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
I have built the project successfully (npm run build)
I have run the linter (npm run lint)
I have added/updated tests as needed
My changes do not introduce new warnings or errors
Additional Context
Summary
Raises test coverage and fixes three bugs and one broken spec that the new tests exposed.
Coverage
Before
After
Lines
91.56%
96.73%
Branches
77.86%
84.67%
Functions
84.17%
93.82%
Full suite: 706 specs, 0 failures (2 pending specs, unchanged). Lint is clean.
Bug fixes
TypeScriptExpressionCollector: duplicate detection was wrong
collectUniqueExpressions is used when adding routes and providers to array literals. It had four problems:
Identifier values never matched. Any value that wasn't a literal made the objects compare as different, so { path: 'home', component: HomeComponent } was never treated as a duplicate.
Literal values were never compared.{ a: 1 } and { a: 2 } were treated as equal, so one of them was dropped.
Arrays were compared only by their first object element.[{a: 1}, {b: 2}] matched [{a: 1}, {c: 3}].
String-literal keys skipped the name check.{ 'a': 1 } matched { 'b': 1 }.
Property values and array elements are now compared recursively. The comparison also handles true, false and null, and requires literal kinds to match, so '1' no longer equals 1.
⚠️Behavior change: adding a route or provider that already exists with the same identifier values is now skipped. Before this change it was added a second time.
cli-config schematic: crash when devDependencies is missing
getDependencyVersion read json.devDependencies[pkg] and json.peerDependencies[pkg] without checking that those fields exist. A package.json without them threw a TypeError instead of the intended DependencyNotFoundException.
Util.execSync: Ctrl+C detection never fired
error.stderr.toString().endsWith() === "^C" compared a boolean to a string, so it was always false. It is now .endsWith("^C"). Also removed the unused private Util.propertyByPath.
Test fixes
ng-schematics/src/component/index_spec.ts never checked its assertions. The spec didn't await runSchematic, so it finished before its expects ran. The schematic then failed in the background and the error was swallowed. The spec is rewritten so every case awaits the run.
spec/acceptance/new-spec.ts depended on the developer's global config. A customTemplates entry in ~/ignite-ui-cli.json caused an extra GoogleAnalytics.post call and failed two specs locally. The spec now stubs ProjectConfig.globalConfig, as add-spec already does.
Unused public API in @igniteui/cli-core: Util.getCurrentDirectoryBase and Util.formatAngularJsonOptions. They have no callers but are kept to avoid breaking consumers.
Unreachable code: the npm login branch in PackageManager.ensureRegistryUser never runs, because REGISTRY_ATTEMPT_LOGIN is hard-coded to false.
Template paths that don't exist: the Web Components and React base/empty projects list a files folder in templatePaths that isn't there.
Mismatched project type: the React ai-config partial declares projectType: "tsx" instead of "igr-ts". It is only looked up by ID, so this has no effect today.
Computed property names are collapsed to undefined, so distinct entries such as { [firstKey]: 1 } and { [secondKey]: 1 } compare equal and the latter can be dropped. Since computed names are outside getPropertyName's supported set, treat an undefined name as non-equal (except for two spread assignments, whose expressions are compared below).
The reason will be displayed to describe this comment to others. Learn more.
Copilot review overview
🟢 Approval recommended
The fixes are sound; remaining feedback is a non-blocking assertion gap.
Review effort: Balanced Findings: None
Previously missed (1)
In code that hasn't changed since last review
Add assertion for SIGINT exit status 130
packages/core/util/Util.ts:358
The new SIGINT exit status is not covered: the added spec only checks that process.exit was called, so changing this back to process.exit() (which can report success) would still pass. Please assert toHaveBeenCalledWith(130) in Util-spec.ts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Code coverage improvements and bug fixes. See
Additional Contextbelow for details.Type of Change
Affected Packages
igniteui-cli(packages/cli)@igniteui/cli-core(packages/core)@igniteui/angular-templates(packages/igx-templates)@igniteui/angular-schematics(packages/ng-schematics)@igniteui/mcp-server(packages/igniteui-mcp)Checklist
npm run test)npm run build)npm run lint)Additional Context
Summary
Raises test coverage and fixes three bugs and one broken spec that the new tests exposed.
Full suite: 706 specs, 0 failures (2 pending specs, unchanged). Lint is clean.
Bug fixes
TypeScriptExpressionCollector: duplicate detection was wrongcollectUniqueExpressionsis used when adding routes and providers to array literals. It had four problems:{ path: 'home', component: HomeComponent }was never treated as a duplicate.{ a: 1 }and{ a: 2 }were treated as equal, so one of them was dropped.[{a: 1}, {b: 2}]matched[{a: 1}, {c: 3}].{ 'a': 1 }matched{ 'b': 1 }.Property values and array elements are now compared recursively. The comparison also handles
true,falseandnull, and requires literal kinds to match, so'1'no longer equals1.cli-configschematic: crash whendevDependenciesis missinggetDependencyVersionreadjson.devDependencies[pkg]andjson.peerDependencies[pkg]without checking that those fields exist. Apackage.jsonwithout them threw aTypeErrorinstead of the intendedDependencyNotFoundException.Util.execSync: Ctrl+C detection never firederror.stderr.toString().endsWith() === "^C"compared a boolean to a string, so it was alwaysfalse. It is now.endsWith("^C"). Also removed the unused privateUtil.propertyByPath.Test fixes
ng-schematics/src/component/index_spec.tsnever checked its assertions. The spec didn't awaitrunSchematic, so it finished before itsexpects ran. The schematic then failed in the background and the error was swallowed. The spec is rewritten so every case awaits the run.spec/acceptance/new-spec.tsdepended on the developer's global config. AcustomTemplatesentry in~/ignite-ui-cli.jsoncaused an extraGoogleAnalytics.postcall and failed two specs locally. The spec now stubsProjectConfig.globalConfig, asadd-specalready does.New and extended specs
TypeScriptExpressionCollectorspec/unit/TypeScriptExpressionCollector-spec.ts(new)IgniteUIForWebComponentsTemplatespec/unit/IgniteUIForWebComponentsTemplate-spec.ts(new)generateConfigandregisterInProjectroutes; 0% → 100%componentschematiccomponent/index_spec.ts(rewritten)startschematicstart/index_spec.ts(new)spec/templates/template-contracts-spec.ts(new)blazor-spec,jquery-spec,webcomponents-specemptyextra config andscaffold, jQueryemptythemes and upgrade, Web Components_baseBaseProjectLibraryBaseProjectLibrary-specregisterTemplate,getComponentGroups,getComponentNamesByGroup, unknown project; → 100%cli-configcli-config/index_specDependencyNotFoundException,"none"agents and assistantsPackageManagerpackageManager-specpackage.jsonwithoutdependenciesUtilUtil-specmerge,execSyncinterrupt handling,gitInit,truncate,createDirectory,formatChoices,getOSFriendlyNameFound but not changed (follow-ups)
@igniteui/cli-core:Util.getCurrentDirectoryBaseandUtil.formatAngularJsonOptions. They have no callers but are kept to avoid breaking consumers.npm loginbranch inPackageManager.ensureRegistryUsernever runs, becauseREGISTRY_ATTEMPT_LOGINis hard-coded tofalse.base/emptyprojects list afilesfolder intemplatePathsthat isn't there.ai-configpartial declaresprojectType: "tsx"instead of"igr-ts". It is only looked up by ID, so this has no effect today.