UNPKG

@teambit/tester

Version:
53 lines (52 loc) 1.81 kB
import type { Logger } from '@teambit/logger'; import type { EnvService, ExecutionContext, EnvDefinition, Env, EnvContext, ServiceTransformationMap } from '@teambit/envs'; import type { Workspace } from '@teambit/workspace'; import type { PubSubEngine } from 'graphql-subscriptions'; import type { DevFilesMain } from '@teambit/dev-files'; import type { Tester, CallbackFn } from './tester'; import { Tests } from './tester'; import type { TesterOptions } from './tester.main.runtime'; export declare const OnTestsChanged = "OnTestsChanged"; type TesterTransformationMap = ServiceTransformationMap & { getTester: () => Tester; }; export type TesterDescriptor = { /** * id of the tester (e.g. jest/mocha) */ id: string; /** * display name of the tester (e.g. Jest / Mocha) */ displayName: string; /** * icon of the configured tester. */ icon: string; /** * string containing the config for display. */ config: string; version?: string; }; export declare class TesterService implements EnvService<Tests, TesterDescriptor> { readonly workspace: Workspace; private logger; private pubsub; private devFiles; name: string; constructor(workspace: Workspace, logger: Logger, pubsub: PubSubEngine, devFiles: DevFilesMain); _callback: CallbackFn | undefined; render(env: EnvDefinition): string; getDescriptor(environment: EnvDefinition): { id: string; displayName: string; icon: string; config: string; version: string; } | undefined; transform(env: Env, context: EnvContext): TesterTransformationMap | undefined; onTestRunComplete(callback: CallbackFn): void; run(context: ExecutionContext, options: TesterOptions): Promise<Tests>; } export {};