// App import { Component } from 'angular2/core'; @Component({ selector: 'app', template: '{{ sayHello() }}' }) export class App { public name: string = 'John'; sayHello(): string { return `Hello ${this.name}`; } } // App tests import { it, describe, expect, } from 'angular2/testing'; describe('App', () => { beforeEach(function() { this.app = new App(); }); it('should have name property', function() { expect(this.app.name).toBe('John'); }); it('should say hello with name property', function() { expect(this.app.sayHello()).toBe('Hello John'); }); });