Skip to content

feat(unit): declare generated mocks and inject ready values - #1182

Draft
omermorad wants to merge 10 commits into
feat/v5-default-sociablefrom
feat/v5-explicit-dependency-values
Draft

omermorad wants to merge 10 commits into
feat/v5-default-sociablefrom
feat/v5-explicit-dependency-values

Conversation

@omermorad

Copy link
Copy Markdown
Collaborator

Use .mock(Token) to stop graph construction and inject a generated mock. Configure method behavior through unitRef.get(Token) after compilation. When a real constructor needs an answer during compilation, pass a ready value with .final(Token, value). Suites injects that exact value.

This removes .mock(Token).impl(callback) and the one-argument .mock(Token).final(value) from the supported TypeScript surface. Qualified dependencies keep the qualifier in the last argument.

The first commit exercises these operations through packed Jest and Vitest consumers.

@codecov

codecov Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.72727% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.56%. Comparing base (a3602be) to head (9fe33d6).

Files with missing lines Patch % Lines
...ages/core/src/services/builders/testbed-builder.ts 78.94% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@                     Coverage Diff                      @@
##           feat/v5-default-sociable    #1182      +/-   ##
============================================================
+ Coverage                     93.51%   93.56%   +0.05%     
============================================================
  Files                            33       33              
  Lines                          1017     1025       +8     
  Branches                        212      215       +3     
============================================================
+ Hits                            951      959       +8     
  Misses                           28       28              
  Partials                         38       38              
Flag Coverage Δ
core.unit 91.82% <92.72%> (+0.10%) ⬆️
di.injectionjs 89.18% <ø> (ø)
di.inversify 97.59% <ø> (ø)
di.nestjs 100.00% <ø> (ø)
doubles.jest 96.66% <ø> (ø)
doubles.vitest 96.55% <ø> (ø)
unit 98.57% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.

@omermorad
omermorad added this pull request to stack #1168 November 28, 2026 21:20
@omermorad omermorad added the target: v5 Deferred changes requiring a future major release label Nov 28, 2026

This branch has not been deployed

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

Labels

target: v5 Deferred changes requiring a future major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant