sao-clasp
Version:
gas clasp project template
17 lines (15 loc) • 473 B
text/typescript
import { getDayFormat } from './util';
jest.unmock('./util');
describe('util', () => {
describe('getDayFormat()', () => {
it('no parameter', () => {
const now = new Date();
const expected = `${now.getFullYear()}-${now.getMonth() + 1}-${now.getDate()}`;
expect(getDayFormat()).toBe(expected);
});
it('with date parameter', () => {
const date = new Date(2018, 2, 9);
expect(getDayFormat(date)).toBe('2018-3-9');
});
});
});