import { it, inject, injectAsync, beforeEachProviders, TestComponentBuilder } from 'angular2/testing'; import {Component, provide} from 'angular2/core'; import {BaseRequestOptions, Http} from 'angular2/http'; import {MockBackend} from 'angular2/http/testing'; // Load the implementations that should be tested import { XLarge } from './x-large'; describe('x-large directive', () => { // Create a test component to test directives @Component({ template: '', directives: [XLarge] }) class TestComponent {} it('should sent font-size to x-large', injectAsync([TestComponentBuilder], (tcb) => { return tcb.overrideTemplate(TestComponent, '
Content
') .createAsync(TestComponent).then((fixture: any) => { fixture.detectChanges(); let compiled = fixture.debugElement.nativeElement.children[0]; expect(compiled.style.fontSize).toBe('x-large'); }); })); });