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

Feature Request: inject a directive with providers in MockRender #3053

Closed
satanTime opened this issue Jul 13, 2022 · 1 comment · Fixed by #3054
Closed

Feature Request: inject a directive with providers in MockRender #3053

satanTime opened this issue Jul 13, 2022 · 1 comment · Fixed by #3054
Assignees
Labels

Comments

@satanTime
Copy link
Member

satanTime commented Jul 13, 2022

Describe the feature or problem you'd like to solve

To test @Self decorators, we need to inject providers via directive.

The code below should work.

@Component({
  selector: 'target',
  template: `{{ service.name }}`,
})
class TargetComponent {
  constructor(@Self() public service: TargetService) {}
}

Proposed solution

MockRender injects a directive with providers if a class has been passed into MockRender.

Additional context

https://gitter.im/ng-mocks/community?at=62c2cf6b8fe56a38b5135031

@satanTime satanTime added the enhancement New feature or request label Jul 13, 2022
@satanTime satanTime self-assigned this Jul 13, 2022
satanTime added a commit to satanTime/ng-mocks that referenced this issue Jul 13, 2022
satanTime added a commit to satanTime/ng-mocks that referenced this issue Jul 13, 2022
satanTime added a commit to satanTime/ng-mocks that referenced this issue Jul 13, 2022
satanTime added a commit to satanTime/ng-mocks that referenced this issue Jul 14, 2022
satanTime added a commit to satanTime/ng-mocks that referenced this issue Jul 14, 2022
satanTime added a commit to satanTime/ng-mocks that referenced this issue Jul 14, 2022
satanTime added a commit that referenced this issue Jul 14, 2022
feat(MockRender): supports Self providers #3053
@satanTime
Copy link
Member Author

v14.1.0 has been released and contains a fix for the issue. Feel free to reopen the issue or to submit a new one if you meet any problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant