Skip to content

Conversation

@slifty
Copy link
Contributor

@slifty slifty commented Jan 10, 2026

This PR removes our use of shallow-render and replaces it with ng-mock which is a commonly used mocking library with more community support.

This is an extensive set of changes, so it's broken into smaller parts for easier review; ultimately, however, we will want to squash the commits into a single migration commit.

Resolves #879

@slifty slifty force-pushed the 879-migrate-to-ng-mocks branch from 555318f to 245fe0f Compare January 10, 2026 01:39
@slifty slifty marked this pull request as draft January 10, 2026 01:40
@slifty slifty force-pushed the 879-migrate-to-ng-mocks branch 4 times, most recently from 08b325a to c3c009b Compare January 13, 2026 15:41
@codecov
Copy link

codecov bot commented Jan 13, 2026

Codecov Report

❌ Patch coverage is 52.50000% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 47.75%. Comparing base (2c8c8c3) to head (b9cea03).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/test/ng-mocks-matchers.ts 34.48% 15 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #883      +/-   ##
==========================================
+ Coverage   47.10%   47.75%   +0.65%     
==========================================
  Files         372      351      -21     
  Lines       11495    11292     -203     
  Branches     1914     1889      -25     
==========================================
- Hits         5415     5393      -22     
+ Misses       5896     5709     -187     
- Partials      184      190       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@slifty
Copy link
Contributor Author

slifty commented Jan 13, 2026

It passes! I'm going to have Claude attempt to organize things into better clumps of commits that we can review in pieces, and then it's possible would still want to squash them into changes.

@slifty slifty force-pushed the 879-migrate-to-ng-mocks branch from c3c009b to 804017f Compare January 13, 2026 15:53
@slifty slifty requested a review from aasandei-vsp January 13, 2026 15:58
@slifty slifty marked this pull request as ready for review January 13, 2026 15:58
@slifty slifty changed the title WIP: Migrate to ng-mock Migrate to ng-mock Jan 13, 2026
Copy link
Contributor

@aasandei-vsp aasandei-vsp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran the tests locally after an npm install and everything passed. Tests look better than before, so it's definitely a step forward.

ngMocks.globalKeep(NgbDropdownModule);
ngMocks.globalKeep(NgbPaginationModule);
ngMocks.globalKeep(CountUpDirective);
ngMocks.globalKeep(CountUpModule);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder why we are not mocking these too.

We were using a library called `shallow-render` to help with mocking
angular components for our tests.  That library is not maintained by
a large community, and was falling behind major angular updates.

`ng-mocks` is a much more popular library for angular testing.  It also
provides more functionality beyond just shallow component mocking.

Issue #879 Remove shallow-render dependency

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@slifty slifty force-pushed the 879-migrate-to-ng-mocks branch from 804017f to b9cea03 Compare January 15, 2026 17:31
@slifty slifty merged commit 4aeb05e into main Jan 15, 2026
8 checks passed
@slifty slifty deleted the 879-migrate-to-ng-mocks branch January 15, 2026 17:36
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.

Remove shallow-render dependency

3 participants