Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document sociable unit tests technique #231

Open
1 task done
soryy708 opened this issue Dec 15, 2023 · 0 comments
Open
1 task done

Document sociable unit tests technique #231

soryy708 opened this issue Dec 15, 2023 · 0 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@soryy708
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe it

It's technically possible to make sociable unit tests with Automock, but it's not a first-class citizen.

Describe the solution you'd like

Documentation about how to achieve sociable unit tests (with current workarounds, or if it will become a first class citizen then with the new/changed api), the motivation and nuances...

What is the motivation / use case for changing the behavior?

const u1 = TestBed.create(Service1).compile();
const dep = u1.unitRef.get(Service3);
const u2 = TestBed.create(Service2).mock(Service1).using(u1.unit).mock(Service3).using(dep).compile();

This is non-trivial usage, and it has nuances: dependencies that are common between u1 and u2 must be explicitly made identical.

@omermorad omermorad added the documentation Improvements or additions to documentation label May 30, 2024
@omermorad omermorad self-assigned this May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants