1 import * as moment from 'moment';
3 import { RelativeDatePipe } from './relative-date.pipe';
5 describe('RelativeDatePipe', () => {
6 const pipe = new RelativeDatePipe();
8 it('create an instance', () => {
9 expect(pipe).toBeTruthy();
12 it('transforms without value', () => {
13 expect(pipe.transform(undefined)).toBe('unknown');
16 it('transforms "in 7 days"', () => {
17 const value = moment()
20 expect(pipe.transform(value)).toBe('in 7 days');
23 it('transforms "7 days ago"', () => {
24 const value = moment()
27 expect(pipe.transform(value)).toBe('7 days ago');