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

Testing Directive Controllers #2

Open
thynctank opened this issue Jun 18, 2014 · 0 comments
Open

Testing Directive Controllers #2

thynctank opened this issue Jun 18, 2014 · 0 comments

Comments

@thynctank
Copy link

Sorry if there's a better place for comment, but I didn't find one on your rendered blog or in the source for it.

Regarding https://github.com/dagingaa/dagingaa.github.com/blob/master/_posts/2014-03-03-testing-angular-directive-controllers-with-jasmine-and-karma.md

You have a directive controller which defines methods on $scope, but many times we need to define methods on this, so that the controller can be used in other directives which get transcluded into the current one. (the controller gets injected as an addl param on the child directive's link function, so long as there is a require parameter of "^parentDirective".

Any idea if there's a way to test these?

My thinking is I may not want to test the controller as it's internals, and so long as I'm testing the behaviors of the directives I'm happy with it from a BDD perspective. If I was aiming for 100% coverage that would be another story.

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

1 participant