Skip to content

Commit ebf2407

Browse files
renovate[bot]abeglovajonkafton
authored
fix(deps): update dependency next-router-mock to v1 (#2267)
* fix(deps): update dependency next-router-mock to v1 * update yarn lock * Explicit type annotation for nextNavigationMocks --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Anastasia Beglova <[email protected]> Co-authored-by: Jon Kafton <[email protected]>
1 parent ed06995 commit ebf2407

File tree

3 files changed

+77
-58
lines changed

3 files changed

+77
-58
lines changed

frontends/ol-test-utilities/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"dom-accessibility-api": "^0.7.0",
1515
"lodash": "^4.17.21",
1616
"moment-timezone": "^0.6.0",
17-
"next-router-mock": "^0.9.13",
17+
"next-router-mock": "^1.0.0",
1818
"tiny-invariant": "^1.3.1"
1919
},
2020
"peerDependencies": {

frontends/ol-test-utilities/src/mocks/nextNavigation.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,17 @@ const prependPathIfNeeded = (url: mocks.Url) => {
5151
mocks.memoryRouter.push = (url) => originalPush(prependPathIfNeeded(url))
5252
mocks.memoryRouter.replace = (url) => originalReplace(prependPathIfNeeded(url))
5353

54-
export const nextNavigationMocks = {
54+
interface NextNavigationMocks {
55+
memoryRouter: typeof mocks.memoryRouter
56+
useRouter: typeof mocks.useRouter
57+
notFound: jest.Mock
58+
redirect: jest.Mock
59+
usePathname: () => string
60+
useSearchParams: () => URLSearchParams
61+
useParams: () => Record<string, string>
62+
}
63+
64+
export const nextNavigationMocks: NextNavigationMocks = {
5565
...mocks,
5666
notFound: jest.fn(),
5767
redirect: jest.fn().mockImplementation((url: string) => {

yarn.lock

Lines changed: 65 additions & 56 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)