17.10.2018 Views

Angular

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

}<br />

}<br />

It can be tested configuring the spec file like this<br />

import { TestBed, inject } from '@angular/core/testing';<br />

import { ReversePipe } from './reverse.pipe';<br />

describe('ReversePipe', () => {<br />

beforeEach(() => {<br />

TestBed.configureTestingModule({<br />

providers: [ReversePipe],<br />

});<br />

});<br />

it('should be created', inject([ReversePipe], (reversePipe: ReversePipe) => {<br />

expect(reversePipe).toBeTruthy();<br />

}));<br />

it('should reverse a string', inject([ReversePipe], (reversePipe: ReversePipe) => {<br />

expect(reversePipe.transform('abc')).toEqual('cba');<br />

}));<br />

});<br />

GoalKicker.com – <strong>Angular</strong> 2 Notes for Professionals 33

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!