Skip to content

#10919 fix(mock-service): mock own object properties#13376

Open
satanTime wants to merge 2 commits intohelp-me-mom:mainfrom
satanTime:issues/10919
Open

#10919 fix(mock-service): mock own object properties#13376
satanTime wants to merge 2 commits intohelp-me-mom:mainfrom
satanTime:issues/10919

Conversation

@satanTime
Copy link
Copy Markdown
Member

Closes #10919

Summary

  • mock zero-argument classes from a real instance first so own object properties are preserved
  • fall back to prototype-only mocking when instantiation is not safe
  • add root and MockService regression coverage for nested object methods

Validation

  • COMPOSE_PROJECT_NAME=ngmocks_i10919_1145 sh test.sh root
  • COMPOSE_PROJECT_NAME=ngmocks_i10919_1145 sh test.sh coverage
  • COMPOSE_PROJECT_NAME=ngmocks_i10919_1145 sh test.sh e2e
  • COMPOSE_PROJECT_NAME=ngmocks_i10919_1145 sh test.sh a5es5
  • COMPOSE_PROJECT_NAME=ngmocks_i10919_1145 sh test.sh a14
  • COMPOSE_PROJECT_NAME=ngmocks_i10919_1145 sh test.sh a20

Coverage

  • libs/ng-mocks/src/lib/mock-service/mock-service.ts: LF/LH 40/40, BRF/BRH 29/29

@satanTime satanTime self-assigned this Mar 21, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (08fa9e6) to head (1835cca).

Additional details and impacted files
@@            Coverage Diff            @@
##              main    #13376   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          228       229    +1     
  Lines         4168      4219   +51     
  Branches      1187      1198   +11     
=========================================
+ Hits          4168      4219   +51     

☔ 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.

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.

Bug: AutoSpy not working as expected

1 participant