UNPKG

testplane

Version:

Tests framework based on mocha and wdio

72 lines (71 loc) 2.19 kB
/// <reference types="node" /> /// <reference types="node" /> export declare const WsDriverMessage: { readonly Request: 0; readonly Response: 1; }; export type WsDriverMessageType = (typeof WsDriverMessage)[keyof typeof WsDriverMessage]; export declare const WsDriverCompression: { readonly None: 0; readonly GZIP: 1; readonly ZSTD: 2; }; export type WsDriverCompressionType = (typeof WsDriverCompression)[keyof typeof WsDriverCompression]; export declare const WsDriverMethod: { readonly get: 0; readonly head: 1; readonly post: 2; readonly put: 3; readonly delete: 4; readonly connect: 5; readonly options: 6; readonly trace: 7; readonly patch: 8; }; export type WsDriverMethodType = (typeof WsDriverMethod)[keyof typeof WsDriverMethod]; export type WsDriverRequestMethodString = "get" | "head" | "post" | "put" | "delete" | "options" | "trace" | "patch" | "GET" | "POST" | "PUT" | "PATCH" | "HEAD" | "DELETE" | "OPTIONS" | "TRACE"; interface IncomingWsDriverGeneralMessage { requestId: number; statusCode: number; isProtocolError: boolean; requestPath: string; rawBody: Buffer; } interface IncomingWsDriverJsonMessage extends IncomingWsDriverGeneralMessage { isJson: true; body: Error | Record<string, unknown>; } interface IncomingWsDriverStringMessage extends IncomingWsDriverGeneralMessage { isJson: false; body: Error | string; } export type IncomingWsDriverMessage = IncomingWsDriverJsonMessage | IncomingWsDriverStringMessage; export interface RequestWsDriverOptions { path?: string; method?: WsDriverRequestMethodString; json?: Record<string, unknown>; } export interface RequestWsDriverResponse { url: string; method: string; requestId: number; statusCode: number; statusMessage: string; req: { id: number; method: string; path: string; host: string; res: RequestWsDriverResponse; }; request: { id: number; options: RequestWsDriverOptions; requestUrl: URL; response: RequestWsDriverResponse; }; ok: boolean; rawBody: Buffer; body: unknown; } export {};