From ae3fcb5bd89a4ac908ba6d4cdb1be4e7c7f0ea81 Mon Sep 17 00:00:00 2001 From: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Date: Tue, 22 Nov 2022 21:41:34 -0800 Subject: [FileSystemRouter] Fix reload() --- test/bun.js/filesystem_router.test.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test/bun.js/filesystem_router.test.ts') diff --git a/test/bun.js/filesystem_router.test.ts b/test/bun.js/filesystem_router.test.ts index 168543e41..a73e98c2d 100644 --- a/test/bun.js/filesystem_router.test.ts +++ b/test/bun.js/filesystem_router.test.ts @@ -349,6 +349,22 @@ it(".query works", () => { } }); +it("reload() works", () => { + // set up the test + const { dir } = make(["posts.tsx"]); + + const router = new Bun.FileSystemRouter({ + dir, + style: "nextjs", + assetPrefix: "/_next/static/", + origin: "https://nextjs.org", + }); + + expect(router.match("/posts").name).toBe("/posts"); + router.reload(); + expect(router.match("/posts").name).toBe("/posts"); +}); + it(".query works with dynamic routes, including params", () => { // set up the test const { dir } = make(["posts/[id].tsx"]); -- cgit v1.2.3