Skip to content

feat(unit): compose known collaborators by default in sociable tests - #1181

Draft
omermorad wants to merge 3 commits into
feat/v5-doubles-fixture-isolationfrom
feat/v5-default-sociable
Draft

omermorad wants to merge 3 commits into
feat/v5-doubles-fixture-isolationfrom
feat/v5-default-sociable

Conversation

@omermorad

Copy link
Copy Markdown
Collaborator

TestBed.sociable(Root).compile() constructs known concrete collaborators recursively. Use .expose(A, B) to limit the real graph. Explicit boundaries are resolved before constructing the collaborator.

In v4 the public TypeScript signature offered only .expose() initially. Bare compilation is a new typed entry point. The former v5 draft selector .compose() is removed.

The packed TypeScript consumer tests exercise bare compilation, selective exposure, bindings, and guarded boundaries. Relates to #820.

@codecov

codecov Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.51%. Comparing base (ed3bf09) to head (a3602be).

Additional details and impacted files
@@                          Coverage Diff                          @@
##           feat/v5-doubles-fixture-isolation    #1181      +/-   ##
=====================================================================
+ Coverage                              93.49%   93.51%   +0.01%     
=====================================================================
  Files                                     33       33              
  Lines                                   1014     1017       +3     
  Branches                                 212      212              
=====================================================================
+ Hits                                     948      951       +3     
  Misses                                    28       28              
  Partials                                  38       38              
Flag Coverage Δ
core.unit 91.72% <100.00%> (+0.04%) ⬆️
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.

Compile a sociable test directly to construct adapter-recognized collaborators. Select a finite real scope with one expose call before declaring boundaries.

BREAKING CHANGE: The v5 builder uses sociable(Root) for recursive construction and removes the draft compose() selector. For v4 TypeScript tests, replace repeated expose(A).expose(B) calls with expose(A, B). Declare mock or final boundaries for collaborators that should be substituted.
@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