UNPKG

jest-date

Version:

Custom jest matchers to test dates

23 lines (22 loc) 882 B
interface NotADateErrorOptions { excludeExpected?: boolean; invert?: boolean; } declare class NotADateError extends Error { constructor(type: 'expected' | 'received', date: Date, matcherFn: Function, options?: NotADateErrorOptions); } declare function checkDate(type: 'received' | 'expected', date: Date, matcher: Function, options?: NotADateErrorOptions): void; interface DeriveRelativeMessage { name: string; expected: Date; received: Date; invert: boolean; } declare function deriveRelativeDateMessage({ name, expected, received, invert, }: DeriveRelativeMessage): string; interface DeriveWeekdayMessage { name: string; received: Date; invert: boolean; } declare function deriveWeekdayMessage({ name, received, invert }: DeriveWeekdayMessage): string; export { NotADateError, checkDate, deriveRelativeDateMessage, deriveWeekdayMessage, };