Skip to content

test: add Angular version test matrix (toolchain swap-in-place)#108

Closed
JuroUhlar wants to merge 1 commit into
mainfrom
test/angular-version-matrix
Closed

test: add Angular version test matrix (toolchain swap-in-place)#108
JuroUhlar wants to merge 1 commit into
mainfrom
test/angular-version-matrix

Conversation

@JuroUhlar

Copy link
Copy Markdown
Contributor

What

Adds a CI workflow that verifies the library builds and its unit tests pass against every supported Angular major (15–21).

This is a simpler alternative to the scaffolding approach in #85. Instead of generating a fresh Angular workspace per version, it keeps the committed workspace (angular.json, tsconfig*, jest config) and just swaps the installed Angular toolchain, then runs the existing ng build + jest.

How

A single matrix job. The only per-version knowledge is the compatibility table in matrix.include (Node / TypeScript / zone.js / jest-preset-angular), which is intrinsic to Angular's own support policy:

  • Pin toolchainpnpm add the version-matched @angular/*, ng-packagr, typescript, zone.js, jest-preset-angular.
  • Buildng build fingerprintjs-pro-angular (catches ng-packagr / compiler-cli breakage).
  • Testpnpm test (the existing jest suite; catches runtime/API breakage).

Footprint

3 files: .github/workflows/test-matrix.yml, .node-version, and an engines field in package.json.

Scope / known trade-off

This covers library build + unit tests across 15–21. It does not exercise each version's freshly generated project scaffolding, nor does it compile a real consumer app against the published package. A follow-up can add a consumer-build job (build the SDK to dist, then compile committed per-version demo apps against it) to close that gap — kept out of this PR to keep the first step minimal.

Draft: version pins in the matrix table may need a nudge on first CI run; that tuning is data in one table, not logic.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Fpy8yBUra4yxpMp5F9Xm7a


Generated by Claude Code

Replace the per-version workspace scaffolding approach with a declarative
CI matrix that keeps the committed workspace and only swaps the installed
Angular toolchain (core/common/cli/compiler-cli/ng-packagr) plus the
version-matched TypeScript, zone.js and jest-preset-angular. Each matrix
entry builds the library and runs the existing jest suite.

Also add .node-version and an engines field for local Node consistency.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fpy8yBUra4yxpMp5F9Xm7a
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ This PR doesn't contain any changesets. If there are user-facing changes, don't forget to run:

pnpm exec changeset

to create a changeset.

@github-actions

Copy link
Copy Markdown
Contributor

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements 75% 30/40
🟡 Branches 60% 3/5
🟢 Functions 83.33% 5/6
🟡 Lines 72.97% 27/37

Test suite run success

10 tests passing in 2 suites.

Report generated by 🧪jest coverage report action from ef10927

Show full coverage report
St File % Stmts % Branch % Funcs % Lines Uncovered Line #s
🟡 All files 75 60 83.33 72.97
🔴  src 0 100 100 0
🔴   public-api.ts 0 100 100 0 5-13
🟢  src/lib 93.33 60 100 92.59
🟢   fingerprint.module.ts 100 100 100 100
🟢   fingerprint.providers.ts 100 100 100 100
🟢   fingerprint.service.ts 89.47 60 100 88.88 57,64
🟢   version.ts 100 100 100 100
🟡  src/lib/tokens 66.66 100 0 66.66
🟡   fingerprint-angular-settings-token.ts 66.66 100 0 66.66 7

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants