Easy mocking in Angular for container components

Everybody how tried to write some tests for container ccomponents knows the pain of writing the mocks. This can be very time consuming, since you have to write Mock classes for each used components including inputs etc. The possibility of NO_ERRORS_SCHEMA should NOT be used, since it is suppressing ALL error messages concerning the schema. It is just an option to lead testing ad abdsurdum …

BUT I found a nice module which is a very nice solution: ng-mocks. Mocking a component is then a oneliner in the TestBed configuration:

import { MockComponent } from 'ng-mocks';

// ... 

      declarations: [
        TestedComponent,
        MockComponent(DependencyComponent),
      ]

Custom deployment of Angular applications within your Continuous Delivery

Angular provides already a ng build command as well as an option for production environment. But how can this be transfered to your existing continuous delivery infrastructure. Imaging you have got a Bamboo or Jenkins responsible for building and deploying your software application.

Continue reading “Custom deployment of Angular applications within your Continuous Delivery”

How to setup a new Angular application and use Material Design

In fact it’s quite easy to setup a new Angular application. You just have to use the angular-cli and all the work is done for you. The best part of it: it follows all the recommended best practices from the Angular team. And you should not under-estimated this: you get a fully functioning application with working build tools, also already for production mode and test infrastructure. Automatically created! Only a few commands are needed to be typed in your terminal of choice.

In this article I summarized the necessary steps for a simple angular-application using material design.  Continue reading “How to setup a new Angular application and use Material Design”