Skip to content

Commit eafe3f4

Browse files
committed
fix unit test
1 parent 4956afb commit eafe3f4

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

packages/tests-unit/tests/core/routing/matcher.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ vi.mock("@opennextjs/aws/adapters/config/index.js", () => ({
7171
],
7272
},
7373
},
74+
getStaticAPIRoutes: () => [
75+
{
76+
page: "/api/app",
77+
regex: "^/api/app(?:/)?$",
78+
},
79+
],
7480
}));
7581
vi.mock("@opennextjs/aws/core/routing/i18n/index.js", () => ({
7682
localizePath: (event: InternalEvent) => event.rawPath,

packages/tests-unit/tests/core/routing/routeMatcher.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,6 @@ vi.mock("@opennextjs/aws/adapters/config/index.js", () => ({
4545
routeKeys: {},
4646
namedRegex: "^/app(?:/)?$",
4747
},
48-
{
49-
page: "/api/app",
50-
regex: "^/api/app(?:/)?$",
51-
routeKeys: {},
52-
namedRegex: "^/api/app(?:/)?$",
53-
},
5448
{
5549
page: "/page",
5650
regex: "^/page(?:/)?$",
@@ -66,6 +60,12 @@ vi.mock("@opennextjs/aws/adapters/config/index.js", () => ({
6660
],
6761
},
6862
},
63+
getStaticAPIRoutes: () => [
64+
{
65+
page: "/api/app",
66+
regex: "^/api/app(?:/)?$",
67+
},
68+
],
6969
}));
7070

7171
describe("routeMatcher", () => {

0 commit comments

Comments
 (0)