fix forgejo terminal test module resolution
Some checks failed
CI / Validate (push) Failing after 1m2s
Some checks failed
CI / Validate (push) Failing after 1m2s
This commit is contained in:
parent
f9682ca9ea
commit
92d5db44e9
2 changed files with 45 additions and 18 deletions
|
|
@ -5,17 +5,29 @@ const redirect = mock((path: string) => {
|
||||||
throw new Error(`NEXT_REDIRECT:${path}`);
|
throw new Error(`NEXT_REDIRECT:${path}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
mock.module("next/navigation", () => ({
|
const nextNavigationMock = {
|
||||||
redirect,
|
|
||||||
usePathname: () => "/options"
|
|
||||||
}));
|
|
||||||
mock.module("next/navigation.js", () => ({
|
|
||||||
default: {
|
default: {
|
||||||
redirect,
|
redirect,
|
||||||
usePathname: () => "/options"
|
usePathname: () => "/options"
|
||||||
},
|
},
|
||||||
redirect,
|
redirect,
|
||||||
usePathname: () => "/options"
|
usePathname: () => "/options"
|
||||||
|
};
|
||||||
|
|
||||||
|
const nextNavigationResolved = import.meta.resolve("next/navigation");
|
||||||
|
const nextNavigationJsResolved = import.meta.resolve("next/navigation.js");
|
||||||
|
|
||||||
|
mock.module("next/navigation", () => ({
|
||||||
|
...nextNavigationMock
|
||||||
|
}));
|
||||||
|
mock.module("next/navigation.js", () => ({
|
||||||
|
...nextNavigationMock
|
||||||
|
}));
|
||||||
|
mock.module(nextNavigationResolved, () => ({
|
||||||
|
...nextNavigationMock
|
||||||
|
}));
|
||||||
|
mock.module(nextNavigationJsResolved, () => ({
|
||||||
|
...nextNavigationMock
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const {
|
const {
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue