Skip to content

test(coverage): include igx-templates and cover lines touched by strict mode - #1850

Draft
ivanvpetrov wants to merge 1 commit into
ipetrov/fix-template-and-command-bugsfrom
ipetrov/igx-templates-coverage
Draft

ivanvpetrov wants to merge 1 commit into
ipetrov/fix-template-and-command-bugsfrom
ipetrov/igx-templates-coverage

Conversation

@ivanvpetrov

Copy link
Copy Markdown
Contributor

Description

Prepares for enabling TypeScript strict mode (#1613) by testing the code the strict-mode fixes will touch.

Of the strict compiler errors outside spec/, 37 were on lines no test ran:

  • 26 in packages/igx-templates
  • 11 in cli, core and ng-schematics

After this PR, every strict-mode error is on a line the tests run, on a line with no runtime code, or in a file excluded from coverage.

Coverage config

New specs

  • One spec each for the Custom Grid, Custom Tree Grid, Custom Hierarchical Grid, Multi Column Headers and Calendar templates. They cover every feature option, the generated markup, the dependencies added, and the documentation links. These templates were at 14–47% line coverage and 0% branch coverage; they are now at 100%.
  • IgniteUIForReactTemplate.generateConfig: base variables, merging of extra configuration, and the widget and description variables.

Extra cases in existing specs

  • list: custom view templates are grouped under "Views".
  • upgrade: a failed npm install is reported, and the "installed" message is not logged.
  • cli-config (ng-schematics): a malformed angular.json is rethrown as a plain error.

Coverage (local nyc run)

Before After
Lines 96.85% (excluding igx-templates) 97.33% (including igx-templates)
Branches 85.0% 86.18%
packages/igx-templates alone not measured (85.2% lines / 64.2% branches when measured) 98.8% / 91.6%

Related Issue

Part of #1613

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring / code cleanup
  • Build / CI configuration 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

  • I have tested my changes locally (npm run test)
  • 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

This is the second of three stacked PRs for #1613. It is based on #1849 (bug fixes) and should be merged after it. The next PR enables "strict": true and fixes the compiler errors.

Only tests and the nyc config change; there are no source changes. The packages ticked above are the ones whose code the new tests cover.

…ct mode

- stop excluding packages/igx-templates from nyc (keep its files/ dirs excluded)
- add specs for the custom grid, tree grid, hierarchical grid,
  multi-column headers and calendar templates
- add specs for IgniteUIForReactTemplate.generateConfig
- cover the list "Views" group, failed npm install on upgrade and
  cli-config workspace read errors
@ivanvpetrov
ivanvpetrov added this pull request to stack #1851 October 20, 2026 13:32
@coveralls

coveralls commented Oct 20, 2026 •

Copy link
Copy Markdown

Coverage Status

Coverage is 95.388% — ipetrov/igx-templates-coverage into ipetrov/fix-template-and-command-bugs. No base build found for ipetrov/fix-template-and-command-bugs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants