///
import { World } from 'cucumber';
import { EventEmitter } from 'events';
import { JestEnvironment } from '@jest/environment';
import { SerializableError, TestResult } from '@jest/test-result';
import { Config } from '@jest/types';
import SnapshotState from 'jest-snapshot/build/State';
import HasteMap, { FS as HasteFS, ModuleMap } from 'jest-haste-map';
import { Jasmine } from 'jest-jasmine2/build/types';
import JsApiReporter from 'jest-jasmine2/build/jasmine/JsApiReporter';
import HasteResolver from 'jest-resolve';
import Worker from 'jest-worker';
import { Plugin } from 'pretty-format';
import { worker } from './testWorker';
export declare type JestSetupGlobals = {
default: (config: {
config: Config.ProjectConfig;
globalConfig: Config.GlobalConfig;
localRequire: (moduleName: string) => Plugin;
testPath: Config.Path;
}) => SnapshotState;
};
export declare type SerializableResolver = {
config: Config.ProjectConfig;
serializableModuleMap: HasteMap.SerializableModuleMap;
};
export declare type ErrorWithCode = Error & {
code?: string;
};
export declare type Test = {
context: Context;
duration?: number;
path: Config.Path;
tmpPath?: Config.Path;
};
export declare type Context = {
config: Config.ProjectConfig;
hasteFS: HasteFS;
moduleMap: ModuleMap;
resolver: HasteResolver;
};
export declare type OnTestStart = (test: Test) => Promise;
export declare type OnTestFailure = (test: Test, serializableError: SerializableError) => Promise;
export declare type OnTestSuccess = (test: Test, testResult: TestResult) => Promise;
export declare type TestRunnerOptions = {
serial: boolean;
};
export declare type TestRunnerContext = {
changedFiles?: Set;
sourcesRelatedToTestsInChangedFiles?: Set;
};
export declare type TestRunnerSerializedContext = {
changedFiles?: Array;
sourcesRelatedToTestsInChangedFiles?: Set;
};
export declare type WatcherState = {
interrupted: boolean;
};
export interface TestWatcher extends EventEmitter {
state: WatcherState;
new ({ isWatchMode }: {
isWatchMode: boolean;
}): TestWatcher;
setState(state: WatcherState): void;
isInterrupted(): boolean;
isWatchMode(): boolean;
}
export declare type WorkerData = {
config: Config.ProjectConfig;
globalConfig: Config.GlobalConfig;
path: Config.Path;
test: Test;
context?: TestRunnerSerializedContext;
};
export interface WorkerInterface extends Worker {
worker: typeof worker;
}
declare type Location = {
column?: (number | null);
line?: (number | null);
};
declare type Step = {
dataTable?: {
location: Location;
rows: {
location: Location;
cells: {
location: Location;
value: string;
}[];
id: string;
}[];
};
id: string;
keyword: string;
location: Location;
text: string;
};
export declare type JestSuite = {
tags: any[];
steps: Step[];
examples: any[];
id: string;
location: Location;
keyword: string;
name: string;
};
export declare type JestGherkinTest = {
context: Context;
duration?: number;
path: Config.Path;
tmpPath?: Config.Path;
suites: JestSuite[];
};
export declare type JasmineFactory = {
create: (createOptions: Record) => JestEnvironment & Jasmine;
_interface: (jasmine: Jasmine, env: any) => {
describe(description: string, specDefinitions: Function): any;
xdescribe(description: string, specDefinitions: Function): any;
fdescribe(description: string, specDefinitions: Function): any;
it(): any;
xit(): any;
fit(): any;
beforeEach(): any;
afterEach(): any;
beforeAll(): any;
CucumberWorld(): World;
afterAll(): any;
pending(): any;
fail(): any;
spyOn(obj: Record, methodName: string, accessType?: string | undefined): any;
jsApiReporter: JsApiReporter;
jasmine: Jasmine;
};
};
export {};