File size: 371 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import React from 'react'
import { renderToString } from 'react-dom/server'
import * as nextRouter from 'next/router'

import { Foo } from './fixture'

// @ts-expect-error
jest.spyOn(nextRouter, 'useRouter').mockReturnValue({
  pathname: 'Hello',
})

test('mock the interpolated modules should work', () => {
  expect(renderToString(<Foo />)).toBe(`<div>Hello</div>`)
})