import '@testing-library/jest-dom' ; import dayjs from 'dayjs' ; import localizedFormat from 'dayjs/plugin/localizedFormat' ; import minMax from 'dayjs/plugin/minMax' ; import relativeTime from 'dayjs/plugin/relativeTime' ; import { advanceTo } from 'jest-date-mock' ; advanceTo ( new Date ( '2019' ) ) ; dayjs . extend ( localizedFormat ) ; dayjs . extend ( relativeTime ) ; dayjs . extend ( minMax ) ; window . matchMedia = jest . fn ( ) . mockImplementation ( ( query ) => ( { matches : false , media : query , onchange : null , addEventListener : jest . fn ( ) , removeEventListener : jest . fn ( ) , dispatchEvent : jest . fn ( ) , } ) ) ; window . gtag = ( ) : void => { return ; } ; jest . mock ( 'next/router' , ( ) => ( { useRouter : jest . fn ( ) . mockImplementation ( ( ) => ( { query : { } , pathname : '' , } ) ) , } ) ) ;