diff options
author | 2022-11-22 21:41:34 -0800 | |
---|---|---|
committer | 2022-11-22 21:41:34 -0800 | |
commit | ae3fcb5bd89a4ac908ba6d4cdb1be4e7c7f0ea81 (patch) | |
tree | 5423cd3f38209f7cfb231d84fe78096da082a830 /test/bun.js/filesystem_router.test.ts | |
parent | 5767ad3fc59d1973897dd8baf5be601754f50c79 (diff) | |
download | bun-ae3fcb5bd89a4ac908ba6d4cdb1be4e7c7f0ea81.tar.gz bun-ae3fcb5bd89a4ac908ba6d4cdb1be4e7c7f0ea81.tar.zst bun-ae3fcb5bd89a4ac908ba6d4cdb1be4e7c7f0ea81.zip |
[FileSystemRouter] Fix reload()
Diffstat (limited to 'test/bun.js/filesystem_router.test.ts')
-rw-r--r-- | test/bun.js/filesystem_router.test.ts | 16 |
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"]); |