angular / angular-hint

run-time hinting for AngularJS applications
362 stars 45 forks source link

testing this lib #7

Closed btford closed 10 years ago

btford commented 10 years ago

We have unit tests for each individual plugin, but some high-level integration tests for angular-hint itself would be nice.

I think we should flesh out the example app, then use Protractor to E2E test this, asserting that things are logged correctly.

ealtenho commented 10 years ago

@btford I'm trying to set up initial tests https://github.com/angular/angular-hint/commit/14bb4136965922ccc905acd7dfd13de5f9d9bb7c but I'm having trouble wiring things together I believe because of the order in which bootstrapping occurs? Any advice? Should I be focusing on E2E tests instead?

btford commented 10 years ago

We talked in-person, but for posterity: individual modules should have unit tests, this repo should have mostly (maybe entirely) E2E tests.

btford commented 10 years ago

This is resolved now, right?

btford commented 10 years ago

@ealtenho can we run some very simple E2E tests with protractor?

ealtenho commented 10 years ago

Yes @btford in the commit https://github.com/angular/angular-hint/commit/e1e7cdb48de9e742cfefb51cf9e131cdd9cb454f I just pushed I added basic protractor tests . I think these tests will be much less irregular when angularHintLog creates similarly formatted output for all modules (currently some use console.log, some console.group, some console.groupCollapsed).

I am also having a strange issue with my ng-hint default test (commented out in this commit). When I run protractor it does not seem to resolve the route for /allHint.

What is the next step to get continuous tests running?

ealtenho commented 10 years ago

Update: e2e tests in /e2e cover all variations of loading modules with ng-hint-include, ng-hint-exclude, ng-hint or no hinting at all.

We also plan to have a sample application that demonstrates the behavior of AngularHint in an application context.

ealtenho commented 10 years ago

There are now passing e2e tests that test the default logging of AngularHint to the console from each of the AngularHint modules. Additionally, the sample applications example and correctExample showcase the function of AngularHint in a realistic setting. This uncovered the bugs described in #36.