jest-date
Version:
Custom jest matchers to test dates
22 lines (21 loc) • 650 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.toBeThursday = void 0;
const date_fns_1 = require("date-fns");
const utils_1 = require("./utils");
function toBeThursday(received) {
(0, utils_1.checkDate)('received', received, toBeThursday, {
excludeExpected: true,
invert: this.isNot,
});
const messageContext = {
name: toBeThursday.name,
received,
invert: this.isNot,
};
return {
pass: (0, date_fns_1.isThursday)(received),
message: () => (0, utils_1.deriveWeekdayMessage)(messageContext),
};
}
exports.toBeThursday = toBeThursday;