This commit is contained in:
parent
e5867e6f73
commit
4ae32c4f3b
3 changed files with 275 additions and 4 deletions
|
|
@ -4,7 +4,8 @@ const redirect = mock((path: string) => {
|
||||||
throw new Error(`NEXT_REDIRECT:${path}`);
|
throw new Error(`NEXT_REDIRECT:${path}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
mock.module("next/navigation", () => ({ redirect }));
|
mock.module("next/navigation", () => ({ default: { redirect }, redirect }));
|
||||||
|
mock.module("next/navigation.js", () => ({ default: { redirect }, redirect }));
|
||||||
|
|
||||||
describe("legacy page redirects", () => {
|
describe("legacy page redirects", () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,16 @@
|
||||||
import { describe, expect, it } from "bun:test";
|
import { describe, expect, it, mock } from "bun:test";
|
||||||
import { getSubscriptionKey as getLiveSubscriptionKey } from "@islandflow/types";
|
import { getSubscriptionKey as getLiveSubscriptionKey } from "@islandflow/types";
|
||||||
import {
|
|
||||||
|
const redirect = mock((path: string) => {
|
||||||
|
throw new Error(`NEXT_REDIRECT:${path}`);
|
||||||
|
});
|
||||||
|
|
||||||
|
mock.module("next/navigation", () => ({
|
||||||
|
redirect,
|
||||||
|
usePathname: () => "/options"
|
||||||
|
}));
|
||||||
|
|
||||||
|
const {
|
||||||
NAV_ITEMS,
|
NAV_ITEMS,
|
||||||
appendHistoryTail,
|
appendHistoryTail,
|
||||||
buildAlertContextPath,
|
buildAlertContextPath,
|
||||||
|
|
@ -49,7 +59,7 @@ import {
|
||||||
resolveAlertFlowPacket,
|
resolveAlertFlowPacket,
|
||||||
statusLabel,
|
statusLabel,
|
||||||
toggleFilterValue
|
toggleFilterValue
|
||||||
} from "./terminal";
|
} = await import("./terminal");
|
||||||
|
|
||||||
const makeItem = (traceId: string, seq: number, ts: number) => ({
|
const makeItem = (traceId: string, seq: number, ts: number) => ({
|
||||||
trace_id: traceId,
|
trace_id: traceId,
|
||||||
|
|
|
||||||
260
docs/turns/2026-05-30-fix-forgejo-ci-test-mocks.html
Normal file
260
docs/turns/2026-05-30-fix-forgejo-ci-test-mocks.html
Normal file
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue