/
githubmirror
/
dayjs
Обзор
Документация
Войти
/
githubmirror
/
dayjs
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v1.10.5
test/constructor.test.js
18 строк
329 B
Ferdinand Prantl
chore: Allow using `instanceof dayjs` to check, if an object is a `dayjs` instance (#337)
10 янв 2019, 17:49
10 янв 2019, 17:49
6e155b8
Код
Авторство
О чём код?
import MockDate from 'mockdate' import dayjs from '../src' beforeEach(() => { MockDate.set(new Date()) }) afterEach(() => { MockDate.reset() }) it('supports instanceof dayjs', () => { expect(dayjs() instanceof dayjs).toBeTruthy() }) it('does not break isDayjs', () => { expect(dayjs.isDayjs(dayjs())).toBeTruthy() })