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

How to test a service with mocked dependencies services #42

Open
samih-dev opened this issue Nov 2, 2016 · 1 comment
Open

How to test a service with mocked dependencies services #42

samih-dev opened this issue Nov 2, 2016 · 1 comment

Comments

@samih-dev
Copy link

samih-dev commented Nov 2, 2016

Hi
Thanks for creating this, really helps..

I'm facing issue when tried to write unit-tests for a service,
I need to mock the dependencies services that I need for this service with the help of bard.mockService,

The angular way without bardjs usages listed here:
https://docs.angularjs.org/guide/services

  • they use $provide service to override the service with mock version

For controller testing this wasn't a problem as we can instanciate a controller sending the service map it needs using $controller service.

Is there anyway to do this?

@bensinther
Copy link

@samih-dev - I have faced a similar issue here: #36. See section "UPDATE 19.05.2016" - this way you should be able to mock your dependencies.

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

No branches or pull requests

2 participants