Module

x/aleph/server/mock.ts

The Full-stack Framework in Deno.
Go to Latest
class MockServer
import { MockServer } from "https://deno.land/x/aleph@1.0.0-beta.1/server/mock.ts";

The MockServer class to create a minimal server for integration testing.

Examples

Example 1

Deno.test(async () => { const api = new MockServer({ routeGlob: "./routes/**/*.ts" }); const res = await api.fetch("/users?page=1&limit=10"); assertEquals(res.status, 200); assertEquals((await res.json()).length, 10); })

Constructors

new
MockServer(options: MockServerOptions)

Methods

fetch(input: string, init?: RequestInit)