A component-based test architecture for Protractor and AngularJS E2E tests

Usually, when we talk about architecture, we talk about the application itself. We think about layers, domain models and interfaces to structure our code. Most of the time the tests will follow this architecture. We create one test per service and mirror our code.

This is fine for unit and even integration tests, but […]

AngularJS tests with mocked HTML documents

Most of the time, testing AngularJS applications means testing JavaScript. We test services and we test controllers. But what about directives? What about components? How do we test compiled and injected AngularJS code? Plunker But before we start, here’s the running Plunker with the complete example: https://plnkr.co/edit/PKn4tpUDFWyeqJ2Tb7Ba Testing directives/components Around a year ago I wrote […]

Don’t use transitive dependencies in AngularJS modules

Whenever you write an AngularJS application, you will use modules. Modules divide you application into small logical pieces. Some pieces might depended on other, some might be totally independent.

In the example above, you see three modules. A module called MainModule depending on two other modules, called UserModule and UtilModule. Note that this is […]