Permalink
Cannot retrieve contributors at this time
Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign up
Fetching contributors…
| import valueToDate from '../valueToDate'; | |
| const moment = require.requireActual('moment-timezone').tz.setDefault('Europe/Kiev'); | |
| describe('Render valueToDate util', () => { | |
| const date = '21.11.2015', | |
| format = 'DD.MM.YYYY'; | |
| it('with null value', () => { | |
| const value = valueToDate('', format); | |
| expect(value).toEqual(null); | |
| }); | |
| it('with defined value', () => { | |
| const value = valueToDate(date, format); | |
| expect(value).toEqual(moment(date, format)); | |
| }); | |
| it('check value is instanceof moment', () => { | |
| const value = valueToDate(date, format); | |
| expect(value instanceof moment).toBeTruthy(); | |
| }); | |
| }); |