Skip to content

FakeAdapter

@tsed/platform-http

Usage

typescript
import { FakeAdapter } from "@tsed/platform/platform-http/src/types/testing/FakeAdapter";

See /packages/platform/platform-http/src/types/testing/FakeAdapter.ts.

Overview

ts
class FakeAdapter extends PlatformAdapter<any> {
    readonly NAME: string;
    providers: ProviderOpts[];
    static createFakeRawDriver(): {
        (): void;
        use: () => any;
        all: () => any;
        get: () => any;
        patch: () => any;
        post: () => any;
        put: () => any;
        head: () => any;
        delete: () => any;
        options: () => any;
    };
    createApp(): {
        app: any;
        callback(): any;
    };
    multipart(options: PlatformMulterSettings): PlatformMulter;
    statics(endpoint: string, options: PlatformStaticsOptions): any;
    bodyParser(type: string): any;
    mapLayers(layers: PlatformLayer[]): void;
    mapHandler(handler: PlatformContextHandler<PlatformContext>): PlatformContextHandler<PlatformContext<import("../common/index.js").PlatformRequest<any>, import("../common/index.js").PlatformResponse<any>>>;
    useContext(): void;
}

readonly NAME

ts
readonly NAME: string;

providers

ts
providers: ProviderOpts[];

static createFakeRawDriver

ts
static createFakeRawDriver(): {
     (): void;
     use: () => any;
     all: () => any;
     get: () => any;
     patch: () => any;
     post: () => any;
     put: () => any;
     head: () => any;
     delete: () => any;
     options: () => any;
 };

createApp

ts
createApp(): {
     app: any;
     callback(): any;
 };

multipart

ts
multipart(options: PlatformMulterSettings): PlatformMulter;

statics

ts
statics(endpoint: string, options: PlatformStaticsOptions): any;

bodyParser

ts
bodyParser(type: string): any;

mapLayers

ts
mapLayers(layers: PlatformLayer[]): void;

mapHandler

ts
mapHandler(handler: PlatformContextHandler<PlatformContext>): PlatformContextHandler<PlatformContext<import("../common/index.js").PlatformRequest<any>, import("../common/index.js").PlatformResponse<any>>>;

useContext

ts
useContext(): void;

Released under the MIT License.