From e75ce632a494f40c3e983d1f5476f1a41c9f698e Mon Sep 17 00:00:00 2001 From: Sebastien Ringrose Date: Sat, 21 Sep 2024 15:13:48 +0100 Subject: [PATCH] fix: scripts --- example/{singleFileAuth => simpleAuth}/app.ts | 0 scripts/bun/profile.ts | 4 ++-- scripts/deno/auth.ts | 2 +- scripts/deno/profile.ts | 4 ++-- scripts/wrangler/profile.ts | 4 ++-- tests/mocks/httpRouter.ts | 6 +++--- 6 files changed, 10 insertions(+), 10 deletions(-) rename example/{singleFileAuth => simpleAuth}/app.ts (100%) diff --git a/example/singleFileAuth/app.ts b/example/simpleAuth/app.ts similarity index 100% rename from example/singleFileAuth/app.ts rename to example/simpleAuth/app.ts diff --git a/scripts/bun/profile.ts b/scripts/bun/profile.ts index eade3a18..dfc8d5a0 100644 --- a/scripts/bun/profile.ts +++ b/scripts/bun/profile.ts @@ -1,7 +1,7 @@ import Profiler from "../../lib/utils/Profiler.ts"; -import { getTestRouter } from "../../tests/mocks/middleware.ts"; +import { testHttpRouter } from "../../tests/mocks/httpRouter.ts"; -const testRouter = getTestRouter(); +const testRouter = testHttpRouter(); const server = Bun.serve({ port: 8080, fetch(req) { diff --git a/scripts/deno/auth.ts b/scripts/deno/auth.ts index 09f4c9de..6412d75b 100644 --- a/scripts/deno/auth.ts +++ b/scripts/deno/auth.ts @@ -1,4 +1,4 @@ -import router from "../../example/singleFileAuth/app.ts"; +import router from "../../example/simpleAuth/app.ts"; router.middleware.unshift((ctx) => { ctx.state.env = Deno.env.toObject(); diff --git a/scripts/deno/profile.ts b/scripts/deno/profile.ts index 9f388fce..56879d7f 100644 --- a/scripts/deno/profile.ts +++ b/scripts/deno/profile.ts @@ -1,7 +1,7 @@ import Profiler from "../../lib/utils/Profiler.ts"; -import { getTestRouter } from "../../tests/mocks/middleware.ts"; +import { testHttpRouter } from "../../tests/mocks/httpRouter.ts"; -const testRouter = getTestRouter(); +const testRouter = testHttpRouter(); const abortController = new AbortController(); Deno.serve( { diff --git a/scripts/wrangler/profile.ts b/scripts/wrangler/profile.ts index ca0e2993..5e625863 100644 --- a/scripts/wrangler/profile.ts +++ b/scripts/wrangler/profile.ts @@ -1,7 +1,7 @@ import Profiler from "../../lib/utils/Profiler.ts"; -import { getTestRouter } from "../../tests/mocks/middleware.ts"; +import { testHttpRouter } from "../../tests/mocks/httpRouter.ts"; -const testRouter = getTestRouter(); +const testRouter = testHttpRouter(); const handleResults = await Profiler.run(testRouter, { mode: "handle", diff --git a/tests/mocks/httpRouter.ts b/tests/mocks/httpRouter.ts index 2e47b75d..60d97860 100644 --- a/tests/mocks/httpRouter.ts +++ b/tests/mocks/httpRouter.ts @@ -1,4 +1,4 @@ -import { HttpBaseRouter } from "../../lib/routers/httpBaseRouter.ts"; +import { HttpRouter } from "../../lib/routers/httpRouter.ts"; import { testMiddleware2, testMiddleware3, @@ -6,8 +6,8 @@ import { testMiddleware1, } from "./middleware.ts"; -export const mockHttpBaseRouter = () => { - const router = new HttpBaseRouter(); +export const testHttpRouter = () => { + const router = new HttpRouter(); router.addRoute( "/test", [testMiddleware1, testMiddleware2, testMiddleware3],