aboutsummaryrefslogtreecommitdiff
path: root/test/bun.js/filesystem_router.test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'test/bun.js/filesystem_router.test.ts')
-rw-r--r--test/bun.js/filesystem_router.test.ts16
1 files changed, 16 insertions, 0 deletions
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"]);