Skip to content

Commit caea622

Browse files
author
devgioele
committed
use dynamic import instead of require
1 parent e2b3112 commit caea622

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/routers/__test__/nextRouter.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import { expectTypeOf, vi } from 'vitest'
55
import { useQuery, useQueryAndPagination } from '../../zod/routers/nextRouter'
66
import { usePagination } from '../nextRouter'
77

8-
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
9-
vi.mock('next/router', () => require('next-router-mock'))
8+
vi.mock('next/router', async () => await import('next-router-mock'))
109

1110
describe('NextRouter', () => {
1211
beforeEach(() => {

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"extends": "@aboutbits/ts-config/react",
33
"compilerOptions": {
4+
"module": "es2020",
45
"moduleResolution": "node",
56
"skipLibCheck": true
67
},

0 commit comments

Comments
 (0)