Skip to content

PlatformServerlessTest

@tsed/platform-serverless-testing

Usage

typescript
import { PlatformServerlessTest } from "@tsed/platform-serverless-testing";

See /packages/platform/platform-serverless-testing/src/types/PlatformServerlessTest.ts.

Overview

ts
class PlatformServerlessTest extends DITest {
    static callbacks: Record<string, APIGatewayProxyHandler>;
    static instance: any;
    static request: typeof LambdaClientRequest;
    static bootstrap(serverless: {
        bootstrap: (server: Type<any>, settings: TsED.Configuration) => PlatformBuilder;
    }, { server, ...settings }: PlatformBuilderSettings<any> & {
        server: Type<any>;
    }): () => Promise<any>;
    static bootstrap(serverless: {
        bootstrap: (settings: Partial<TsED.Configuration> & {
            lambda?: Type[];
        }) => any;
    }, { server, ...settings }: PlatformBuilderSettings<any>): () => Promise<any>;
    static reset(): Promise<void>;
}

static callbacks

ts
static callbacks: Record<string, APIGatewayProxyHandler>;

static instance

ts
static instance: any;

static request

ts
static request: typeof LambdaClientRequest;

static bootstrap

ts
static bootstrap(serverless: {
     bootstrap: (server: Type<any>, settings: TsED.Configuration) => PlatformBuilder;
 }, { server, ...settings }: PlatformBuilderSettings<any> & {
     server: Type<any>;
 }): () => Promise<any>;

static bootstrap

ts
static bootstrap(serverless: {
     bootstrap: (settings: Partial<TsED.Configuration> & {
         lambda?: Type[];
     }) => any;
 }, { server, ...settings }: PlatformBuilderSettings<any>): () => Promise<any>;

static reset

ts
static reset(): Promise<void>;

Resets the test injector of the test context, so it won't pollute your next test. Call this in your tearDown logic.

Released under the MIT License.