Skip to main content
Module

x/oak_nest/test_deps.ts

Refer to nestjs to realize some common functions for Deno
Go to Latest
import * as oakNest from "https://deno.land/x/oak_nest@v2.0.1/test_deps.ts";

Namespaces

A collection of utility APIs which can make testing of an oak application easier.

Classes

A class which registers middleware (via .use()) and then processes inbound requests against that middleware (via .listen()).

Provides context about the current request and response to middleware functions, and the current instance being processed is the first argument provided a Middleware function.

Provides an way to manage cookies in a request and response on the server as a single iterable collection, as well as the ability to sign and verify cookies to prevent tampering.

An interface for registering middleware that will run when certain HTTP methods and paths are requested, as well as provides a way to parameterize parts of the requested path.

An interface which provides information about the current request. The instance related to the current request is available on the Context's .request property.

An interface to control what response will be sent when the middleware finishes processing the request.

Enums

Standard HTTP status codes.

Variables

Allows external parties to modify the context state.

Functions

Run some shared teardown after each test in the suite.

Make an assertion, error will be thrown if expr does not have truthy value.

Make an assertion that actual and expected are equal, deeply. If not deeply equal, then throw.

Make an assertion that actual is not null or undefined. If not then throw.

Make an assertion that error is an Error. If not then an error will be thrown. An error class and a string that should be included in the error message can also be asserted.

Make an assertion that actual and expected are not equal, deeply. If not then throw.

Make an assertion that actual and expected are not strictly equal. If the values are strictly equal then throw.

Executes a function which returns a promise, expecting it to reject.

Make an assertion that actual and expected are strictly equal. If not then throw.

Executes a function, expecting it to throw. If it does not, then it throws.

Run some shared setup before each test in the suite.

Resolve a Promise after a given amount of milliseconds.

Registers a test suite.

Checks if a given value is an enum

A type guard that determines if the value is an HttpError or not.

Checks if a value is a number.

Checks if value is missing and if so, ignores all validators.

Checks if a given value is a real string.

Registers an individual test case.

Checks if the first number is less than or equal to the second.

Checks if the first number is greater than or equal to the second.

Asynchronously fulfill a response with a file from the local file system.

Creates a mock of Application.

Create a mock of Context or RouterContext.

Creates a mock next() function which can be used when calling middleware.

Validates given object and reject on error.

Interfaces

Registers a test suite.

Registers an individual test case.

Middleware are functions which are chained together to deal with requests.

Options that can be set in a mock context.