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

fix: Adding Interface into constructor throw: CannotInjectValueError - you don't use interfaces without service tokens as injection value. #1373

Open
joseaburt opened this issue Aug 12, 2024 · 1 comment
Labels
status: needs triage Issues which needs to be reproduced to be verified report. type: fix Issues describing a broken feature.

Comments

@joseaburt
Copy link

Description

Guys we are having an issue when we pass interface into a constructor of a service that depedens on a super type.

image

In this image as you can see it is not possible to depend on abstraction it required the same concret class annotated with @Service() annotation.

This is coupling and make testing hard, because for integration testing on my API I need to double the repository to avoid direct database calls or any other 3er party API.

Also it is not possible to change the dependency for a mock one during the testing.

How are you handling this issue guys?

@joseaburt joseaburt added status: needs triage Issues which needs to be reproduced to be verified report. type: fix Issues describing a broken feature. labels Aug 12, 2024
@andvalsol
Copy link

Im having this same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage Issues which needs to be reproduced to be verified report. type: fix Issues describing a broken feature.
Development

No branches or pull requests

2 participants