ng2-pipes
Version:
Useful angular2 pipes
16 lines (12 loc) • 366 B
text/typescript
import {PercentPipe} from "./percent";
describe('PercentPipe', () => {
let pipe: PercentPipe;
beforeEach(() => {
pipe = new PercentPipe();
});
it('should return percent between numbers', () => {
expect(pipe.transform(5)).toEqual(5);
expect(pipe.transform(5, 160)).toEqual(3.125);
expect(pipe.transform(5, 160, true)).toEqual(3);
});
});