Skip to content

Commit 6d8d628

Browse files
committed
e2e
1 parent 150fea0 commit 6d8d628

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { NextResponse } from "next/server";
2+
3+
export async function GET(
4+
_req: Request,
5+
{ params }: { params: Promise<{ "better-auth": string[] }> },
6+
) {
7+
const { "better-auth": slugs } = await params;
8+
9+
return NextResponse.json({
10+
slugs,
11+
});
12+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { expect, test } from "@playwright/test";
2+
3+
test("Dynamic catch-all API route with hyphen param", async ({ request }) => {
4+
const res = await request.get("/api/auth/opennext/is/really/cool");
5+
expect(res.status()).toBe(200);
6+
expect(res.headers()["content-type"]).toBe("application/json");
7+
const json = await res.json();
8+
expect(json).toStrictEqual({ slugs: ["opennext", "is", "really", "cool"] });
9+
});

0 commit comments

Comments
 (0)