import { isWednesday } from 'date-fns' ; import { checkDate , deriveWeekdayMessage } from './utils' ; declare global { namespace jest { interface Matchers < R , T > { example toBeWednesday ( ) : R ; } } } export function toBeWednesday ( this , received ) { checkDate ( 'received' , received , toBeWednesday , { excludeExpected : true , invert : this . isNot , } ) ; const messageContext = { name : toBeWednesday . name , received , invert : this . isNot , } ; return { pass : isWednesday ( received ) , message : ( ) => deriveWeekdayMessage ( messageContext ) , } ; }