Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/deno_nest/tests/common_helper.ts>MockRouter

Refer to nestjs to realize some common functions for Deno, support hono and oak
Go to Latest
class MockRouter
implements IRouter
import { MockRouter } from "https://deno.land/x/deno_nest@v3.7.0/tests/common_helper.ts";

Properties

map: Map<Uppercase<MethodType>, Map<string, MethodHandler>>

Methods

private
handle(
path: string,
fn: MiddlewareHandler,
method: Uppercase<MethodType>,
)
delete(path: string, fn: MiddlewareHandler)
get(path: string, fn: MiddlewareHandler)
notFound(_fn: NotFoundHandler): void
patch(path: string, fn: MiddlewareHandler)
post(path: string, fn: MiddlewareHandler)
put(path: string, fn: MiddlewareHandler)
routes(): void
startServer(options: ListenOptions)
use(fn: MiddlewareHandler)
useOriginMiddleware(_fn: Function, _path?: string): void