@jest/types

  • Version 30.5.1
  • Published
  • 33.6 kB
  • 7 dependencies
  • MIT license

Install

npm i @jest/types
yarn add @jest/types
pnpm add @jest/types

Overview

This package contains shared types of Jest's packages.

Index

Namespaces

namespace Circus

namespace Circus {}

    interface EventHandler

    interface EventHandler {}

      call signature

      (event: AsyncEvent, state: State): void | Promise<void>;

        call signature

        (event: SyncEvent, state: State): void;

          type AsyncEvent

          type AsyncEvent =
          | {
          name: 'setup';
          testNamePattern?: string;
          runtimeGlobals: JestGlobals;
          parentProcess: Process;
          }
          | {
          name: 'include_test_location_in_result';
          }
          | {
          name: 'hook_start';
          hook: Hook;
          }
          | {
          name: 'hook_success';
          describeBlock?: DescribeBlock;
          test?: TestEntry;
          hook: Hook;
          }
          | {
          name: 'hook_failure';
          error: string | Exception;
          describeBlock?: DescribeBlock;
          test?: TestEntry;
          hook: Hook;
          }
          | {
          name: 'test_fn_start';
          test: TestEntry;
          }
          | {
          name: 'test_fn_success';
          test: TestEntry;
          }
          | {
          name: 'test_fn_failure';
          error: Exception;
          test: TestEntry;
          }
          | {
          name: 'test_retry';
          test: TestEntry;
          }
          | {
          name: 'describe_retry';
          describeBlock: DescribeBlock;
          }
          | {
          name: 'test_start';
          test: TestEntry;
          }
          | {
          name: 'test_skip';
          test: TestEntry;
          }
          | {
          name: 'test_todo';
          test: TestEntry;
          }
          | {
          name: 'test_started';
          test: TestEntry;
          }
          | {
          name: 'test_done';
          test: TestEntry;
          }
          | {
          name: 'concurrent_tests_start';
          tests: Array<TestEntry>;
          describeBlock: DescribeBlock;
          }
          | {
          name: 'concurrent_tests_end';
          tests: Array<TestEntry>;
          describeBlock: DescribeBlock;
          }
          | {
          name: 'run_describe_start';
          describeBlock: DescribeBlock;
          }
          | {
          name: 'run_describe_finish';
          describeBlock: DescribeBlock;
          }
          | {
          name: 'run_start';
          }
          | {
          name: 'run_finish';
          }
          | {
          name: 'teardown';
          };

            type AsyncFn

            type AsyncFn = TestFn_2 | HookFn_2;

              type BlockFn

              type BlockFn_2 = Global_2.BlockFn;

                type BlockMode

                type BlockMode = void | 'skip' | 'only' | 'todo';

                  type BlockName

                  type BlockName_2 = Global_2.BlockName;

                    type BlockNameLike

                    type BlockNameLike_2 = Global_2.BlockNameLike;

                      type ConcurrentTestFn

                      type ConcurrentTestFn_2 = Global_2.ConcurrentTestFn;

                        type DescribeBlock

                        type DescribeBlock = {
                        type: 'describeBlock';
                        children: Array<DescribeBlock | TestEntry>;
                        hooks: Array<Hook>;
                        mode: BlockMode;
                        name: BlockName_2;
                        parent?: DescribeBlock;
                        /** @deprecated Please get from `children` array instead */
                        tests: Array<TestEntry>;
                        };

                          type DescribeRetryOptions

                          type DescribeRetryOptions = {
                          logErrorsBeforeRetry?: boolean;
                          numRetries: number;
                          waitBeforeRetry?: number;
                          };

                            type DoneFn

                            type DoneFn = Global_2.DoneFn;

                              type Event

                              type Event_2 = SyncEvent | AsyncEvent;

                                type Exception

                                type Exception = any;

                                  type FormattedError

                                  type FormattedError = string;

                                    type GlobalErrorHandlers

                                    type GlobalErrorHandlers = {
                                    rejectionHandled: Array<(promise: Promise<unknown>) => void>;
                                    uncaughtException: Array<NodeJS.UncaughtExceptionListener>;
                                    unhandledRejection: Array<NodeJS.UnhandledRejectionListener>;
                                    };

                                      type Hook

                                      type Hook = {
                                      asyncError: Error;
                                      fn: HookFn_2;
                                      type: HookType;
                                      parent: DescribeBlock;
                                      seenDone: boolean;
                                      timeout: number | undefined | null;
                                      };

                                        type HookFn

                                        type HookFn_2 = Global_2.HookFn;

                                          type HookType

                                          type HookType = SharedHookType | 'afterEach' | 'beforeEach';

                                            type MatcherResults

                                            type MatcherResults = {
                                            actual: unknown;
                                            expected: unknown;
                                            name: string;
                                            pass: boolean;
                                            };

                                              type RunResult

                                              type RunResult = {
                                              unhandledErrors: Array<FormattedError>;
                                              unhandledErrorsDetailed: Array<Error>;
                                              testResults: TestResults;
                                              };

                                                type SharedHookType

                                                type SharedHookType = 'afterAll' | 'beforeAll';

                                                  type State

                                                  type State = {
                                                  currentDescribeBlock: DescribeBlock;
                                                  currentlyRunningTest?: TestEntry | null;
                                                  describeRetryOptions: WeakMap<DescribeBlock, DescribeRetryOptions>;
                                                  expand?: boolean;
                                                  hasFocusedTests: boolean;
                                                  hasStarted: boolean;
                                                  originalGlobalErrorHandlers?: GlobalErrorHandlers;
                                                  parentProcess: Process | null;
                                                  processErrorGeneration: number;
                                                  randomize?: boolean;
                                                  rootDescribeBlock: DescribeBlock;
                                                  seed: number;
                                                  testNamePattern?: RegExp | null;
                                                  testTimeout: number;
                                                  unhandledErrors: Array<Exception>;
                                                  includeTestLocationInResult: boolean;
                                                  maxConcurrency: number;
                                                  unhandledRejectionErrorByPromise: Map<Promise<unknown>, Exception>;
                                                  unhandledRejectionErrorByPromiseByHook: WeakMap<
                                                  Hook,
                                                  Map<Promise<unknown>, Exception>
                                                  >;
                                                  unhandledRejectionErrorByPromiseTarget: WeakMap<
                                                  Promise<unknown>,
                                                  Map<Promise<unknown>, Exception>
                                                  >;
                                                  };

                                                    type SyncEvent

                                                    type SyncEvent =
                                                    | {
                                                    asyncError: Error;
                                                    mode: BlockMode;
                                                    name: 'start_describe_definition';
                                                    blockName: BlockName_2;
                                                    }
                                                    | {
                                                    mode: BlockMode;
                                                    name: 'finish_describe_definition';
                                                    blockName: BlockName_2;
                                                    }
                                                    | {
                                                    asyncError: Error;
                                                    name: 'add_hook';
                                                    hookType: HookType;
                                                    fn: HookFn_2;
                                                    timeout: number | undefined;
                                                    }
                                                    | {
                                                    asyncError: Error;
                                                    name: 'add_test';
                                                    testName: TestName_2;
                                                    fn: TestFn_2;
                                                    mode?: TestMode;
                                                    concurrent: boolean;
                                                    timeout: number | undefined;
                                                    failing: boolean;
                                                    }
                                                    | {
                                                    name: 'error';
                                                    error: Exception;
                                                    promise?: Promise<unknown>;
                                                    }
                                                    | {
                                                    name: 'error_handled';
                                                    promise: Promise<unknown>;
                                                    };

                                                      type TestCaseStartInfo

                                                      type TestCaseStartInfo = {
                                                      ancestorTitles: Array<string>;
                                                      fullName: string;
                                                      mode: TestMode;
                                                      title: string;
                                                      startedAt?: number | null;
                                                      };

                                                        type TestContext

                                                        type TestContext_2 = Global_2.TestContext;

                                                          type TestEntry

                                                          type TestEntry = {
                                                          type: 'test';
                                                          asyncError: Exception;
                                                          errors: Array<TestError>;
                                                          retryReasons: Array<TestError>;
                                                          fn: TestFn_2;
                                                          invocations: number;
                                                          mode: TestMode;
                                                          concurrent: boolean;
                                                          name: TestName_2;
                                                          numPassingAsserts: number;
                                                          parent: DescribeBlock;
                                                          startedAt?: number | null;
                                                          duration?: number | null;
                                                          seenDone: boolean;
                                                          status?: TestStatus | null;
                                                          timeout?: number;
                                                          failing: boolean;
                                                          unhandledRejectionErrorByPromise: Map<Promise<unknown>, Exception>;
                                                          };

                                                            type TestError

                                                            type TestError = Exception | [Exception | undefined, Exception | undefined];

                                                              type TestFn

                                                              type TestFn_2 = Global_2.TestFn;

                                                                type TestMode

                                                                type TestMode = BlockMode;

                                                                  type TestName

                                                                  type TestName_2 = Global_2.TestName;

                                                                    type TestNameLike

                                                                    type TestNameLike_2 = Global_2.TestNameLike;

                                                                      type TestNamesPath

                                                                      type TestNamesPath = Array<TestName_2 | BlockName_2>;

                                                                        type TestResult

                                                                        type TestResult_2 = {
                                                                        duration?: number | null;
                                                                        errors: Array<FormattedError>;
                                                                        errorsDetailed: Array<MatcherResults | unknown>;
                                                                        /**
                                                                        * Whether [`test.failing()`](https://jestjs.io/docs/api#testfailingname-fn-timeout)
                                                                        * was used.
                                                                        */
                                                                        failing?: boolean;
                                                                        invocations: number;
                                                                        startedAt?: number | null;
                                                                        status: TestStatus;
                                                                        location?: {
                                                                        column: number;
                                                                        line: number;
                                                                        } | null;
                                                                        numPassingAsserts: number;
                                                                        retryReasons: Array<FormattedError>;
                                                                        retryReasonsDetailed: Array<Error>;
                                                                        testPath: TestNamesPath;
                                                                        };

                                                                          type TestResults

                                                                          type TestResults = Array<TestResult_2>;

                                                                            type TestStatus

                                                                            type TestStatus = 'skip' | 'done' | 'todo';

                                                                              namespace Config

                                                                              namespace Config {}

                                                                                interface ConfigGlobals

                                                                                interface ConfigGlobals {}

                                                                                  index signature

                                                                                  [K: string]: unknown;

                                                                                    type Argv

                                                                                    type Argv = Arguments<
                                                                                    Partial<{
                                                                                    all: boolean;
                                                                                    automock: boolean;
                                                                                    bail: boolean | number;
                                                                                    cache: boolean;
                                                                                    cacheDirectory: string;
                                                                                    changedFilesWithAncestor: boolean;
                                                                                    changedSince: string;
                                                                                    ci: boolean;
                                                                                    clearCache: boolean;
                                                                                    clearMocks: boolean;
                                                                                    collectCoverage: boolean;
                                                                                    collectCoverageFrom: string;
                                                                                    collectTests: boolean;
                                                                                    color: boolean;
                                                                                    colors: boolean;
                                                                                    config: string;
                                                                                    coverage: boolean;
                                                                                    coverageDirectory: string;
                                                                                    coveragePathIgnorePatterns: Array<string>;
                                                                                    coverageReporters: Array<string>;
                                                                                    coverageThreshold: string;
                                                                                    debug: boolean;
                                                                                    env: string;
                                                                                    expand: boolean;
                                                                                    findRelatedTests: boolean;
                                                                                    forceExit: boolean;
                                                                                    globals: string;
                                                                                    globalSetup: string | null | undefined;
                                                                                    globalTeardown: string | null | undefined;
                                                                                    haste: string;
                                                                                    ignoreProjects: Array<string>;
                                                                                    injectGlobals: boolean;
                                                                                    json: boolean;
                                                                                    lastCommit: boolean;
                                                                                    logHeapUsage: boolean;
                                                                                    maxWorkers: number | string;
                                                                                    moduleDirectories: Array<string>;
                                                                                    moduleFileExtensions: Array<string>;
                                                                                    moduleNameMapper: string;
                                                                                    modulePathIgnorePatterns: Array<string>;
                                                                                    modulePaths: Array<string>;
                                                                                    noStackTrace: boolean;
                                                                                    notify: boolean;
                                                                                    notifyMode: string;
                                                                                    onlyChanged: boolean;
                                                                                    onlyFailures: boolean;
                                                                                    outputFile: string;
                                                                                    preset: string | null | undefined;
                                                                                    prettierPath: string | null | undefined;
                                                                                    projects: Array<string>;
                                                                                    randomize: boolean;
                                                                                    reporters: Array<string>;
                                                                                    resetMocks: boolean;
                                                                                    resetModules: boolean;
                                                                                    resolver: string | null | undefined;
                                                                                    restoreMocks: boolean;
                                                                                    rootDir: string;
                                                                                    roots: Array<string>;
                                                                                    runInBand: boolean;
                                                                                    seed: number;
                                                                                    showSeed: boolean;
                                                                                    selectProjects: Array<string>;
                                                                                    setupFiles: Array<string>;
                                                                                    setupFilesAfterEnv: Array<string>;
                                                                                    shard: string;
                                                                                    showConfig: boolean;
                                                                                    silent: boolean;
                                                                                    snapshotSerializers: Array<string>;
                                                                                    testEnvironment: string;
                                                                                    testEnvironmentOptions: string;
                                                                                    testFailureExitCode: string | null | undefined;
                                                                                    testMatch: string | Array<string>;
                                                                                    testNamePattern: string;
                                                                                    testPathIgnorePatterns: Array<string>;
                                                                                    testPathPatterns: Array<string>;
                                                                                    testRegex: string | Array<string>;
                                                                                    testResultsProcessor: string;
                                                                                    testRunner: string;
                                                                                    testSequencer: string;
                                                                                    testTimeout: number | null | undefined;
                                                                                    transform: string;
                                                                                    transformIgnorePatterns: Array<string>;
                                                                                    unmockedModulePathPatterns: Array<string> | null | undefined;
                                                                                    updateSnapshot: boolean;
                                                                                    useStderr: boolean;
                                                                                    verbose: boolean;
                                                                                    version: boolean;
                                                                                    watch: boolean;
                                                                                    watchAll: boolean;
                                                                                    watchman: boolean;
                                                                                    watchPathIgnorePatterns: Array<string>;
                                                                                    workerGracefulExitTimeout: number;
                                                                                    workerIdleMemoryLimit: number | string;
                                                                                    workerThreads: boolean;
                                                                                    }>
                                                                                    >;

                                                                                      type CoverageReporterName

                                                                                      type CoverageReporterName = keyof ReportOptions;

                                                                                        type CoverageReporters

                                                                                        type CoverageReporters = Array<CoverageReporterName | CoverageReporterWithOptions>;

                                                                                          type CoverageReporterWithOptions

                                                                                          type CoverageReporterWithOptions<K = CoverageReporterName> =
                                                                                          K extends CoverageReporterName
                                                                                          ? ReportOptions[K] extends never
                                                                                          ? never
                                                                                          : [K, Partial<ReportOptions[K]>]
                                                                                          : never;

                                                                                            type CoverageThresholdValue

                                                                                            type CoverageThresholdValue = {
                                                                                            branches?: number;
                                                                                            functions?: number;
                                                                                            lines?: number;
                                                                                            statements?: number;
                                                                                            };

                                                                                              type DefaultOptions

                                                                                              type DefaultOptions = {
                                                                                              automock: boolean;
                                                                                              bail: number;
                                                                                              cache: boolean;
                                                                                              cacheDirectory: string;
                                                                                              changedFilesWithAncestor: boolean;
                                                                                              ci: boolean;
                                                                                              clearMocks: boolean;
                                                                                              collectCoverage: boolean;
                                                                                              coveragePathIgnorePatterns: Array<string>;
                                                                                              coverageReporters: Array<CoverageReporterName>;
                                                                                              coverageProvider: CoverageProvider;
                                                                                              detectLeaks: boolean;
                                                                                              detectOpenHandles: boolean;
                                                                                              errorOnDeprecated: boolean;
                                                                                              expand: boolean;
                                                                                              extensionsToTreatAsEsm: Array<string>;
                                                                                              fakeTimers: FakeTimers;
                                                                                              forceCoverageMatch: Array<string>;
                                                                                              globals: ConfigGlobals;
                                                                                              haste: HasteConfig;
                                                                                              injectGlobals: boolean;
                                                                                              listTests: boolean;
                                                                                              maxConcurrency: number;
                                                                                              maxWorkers: number | string;
                                                                                              moduleDirectories: Array<string>;
                                                                                              moduleFileExtensions: Array<string>;
                                                                                              moduleNameMapper: Record<string, string | Array<string>>;
                                                                                              modulePathIgnorePatterns: Array<string>;
                                                                                              noStackTrace: boolean;
                                                                                              notify: boolean;
                                                                                              notifyMode: NotifyMode;
                                                                                              openHandlesTimeout: number;
                                                                                              passWithNoTests: boolean;
                                                                                              prettierPath: string;
                                                                                              resetMocks: boolean;
                                                                                              resetModules: boolean;
                                                                                              restoreMocks: boolean;
                                                                                              roots: Array<string>;
                                                                                              runTestsByPath: boolean;
                                                                                              runner: string;
                                                                                              setupFiles: Array<string>;
                                                                                              setupFilesAfterEnv: Array<string>;
                                                                                              skipFilter: boolean;
                                                                                              slowTestThreshold: number;
                                                                                              snapshotFormat: SnapshotFormat;
                                                                                              snapshotSerializers: Array<string>;
                                                                                              testEnvironment: string;
                                                                                              testEnvironmentOptions: Record<string, unknown>;
                                                                                              testFailureExitCode: number;
                                                                                              testLocationInResults: boolean;
                                                                                              testMatch: Array<string>;
                                                                                              testPathIgnorePatterns: Array<string>;
                                                                                              testRegex: Array<string>;
                                                                                              testRunner: string;
                                                                                              testSequencer: string;
                                                                                              transformIgnorePatterns: Array<string>;
                                                                                              useStderr: boolean;
                                                                                              waitForUnhandledRejections: boolean;
                                                                                              watch: boolean;
                                                                                              watchPathIgnorePatterns: Array<string>;
                                                                                              watchman: boolean;
                                                                                              workerGracefulExitTimeout: number;
                                                                                              workerThreads: boolean;
                                                                                              };

                                                                                                type DisplayName

                                                                                                type DisplayName = {
                                                                                                name: string;
                                                                                                color: typeof ForegroundColor;
                                                                                                };

                                                                                                  type FakeableAPI

                                                                                                  type FakeableAPI =
                                                                                                  | 'Date'
                                                                                                  | 'hrtime'
                                                                                                  | 'nextTick'
                                                                                                  | 'performance'
                                                                                                  | 'queueMicrotask'
                                                                                                  | 'requestAnimationFrame'
                                                                                                  | 'cancelAnimationFrame'
                                                                                                  | 'requestIdleCallback'
                                                                                                  | 'cancelIdleCallback'
                                                                                                  | 'setImmediate'
                                                                                                  | 'clearImmediate'
                                                                                                  | 'setInterval'
                                                                                                  | 'clearInterval'
                                                                                                  | 'setTimeout'
                                                                                                  | 'clearTimeout'
                                                                                                  | 'Temporal';

                                                                                                    type FakeTimersConfig

                                                                                                    type FakeTimersConfig = {
                                                                                                    /**
                                                                                                    * If set to `true` all timers will be advanced automatically
                                                                                                    * by 20 milliseconds every 20 milliseconds. A custom time delta
                                                                                                    * may be provided by passing a number.
                                                                                                    *
                                                                                                    * @defaultValue
                                                                                                    * The default is `false`.
                                                                                                    */
                                                                                                    advanceTimers?: boolean | number;
                                                                                                    /**
                                                                                                    * List of names of APIs (e.g. `Date`, `nextTick()`, `setImmediate()`,
                                                                                                    * `setTimeout()`) that should not be faked.
                                                                                                    *
                                                                                                    * @defaultValue
                                                                                                    * The default is `[]`, meaning all APIs are faked.
                                                                                                    */
                                                                                                    doNotFake?: Array<FakeableAPI>;
                                                                                                    /**
                                                                                                    * Sets current system time to be used by fake timers. Accepts a millisecond
                                                                                                    * timestamp, a `Date`, a `Temporal.Instant`, or a `Temporal.ZonedDateTime`.
                                                                                                    *
                                                                                                    * @defaultValue
                                                                                                    * The default is `Date.now()`.
                                                                                                    */
                                                                                                    now?:
                                                                                                    | number
                                                                                                    | Date
                                                                                                    | {
                                                                                                    epochMilliseconds: number;
                                                                                                    };
                                                                                                    /**
                                                                                                    * The maximum number of recursive timers that will be run when calling
                                                                                                    * `jest.runAllTimers()`.
                                                                                                    *
                                                                                                    * @defaultValue
                                                                                                    * The default is `100_000` timers.
                                                                                                    */
                                                                                                    timerLimit?: number;
                                                                                                    /**
                                                                                                    * Use the old fake timers implementation instead of one backed by
                                                                                                    * [`@sinonjs/fake-timers`](https://github.com/sinonjs/fake-timers).
                                                                                                    *
                                                                                                    * @defaultValue
                                                                                                    * The default is `false`.
                                                                                                    */
                                                                                                    legacyFakeTimers?: false;
                                                                                                    };

                                                                                                      type GlobalConfig

                                                                                                      type GlobalConfig = {
                                                                                                      bail: number;
                                                                                                      changedSince?: string;
                                                                                                      changedFilesWithAncestor: boolean;
                                                                                                      ci: boolean;
                                                                                                      collectCoverage: boolean;
                                                                                                      collectCoverageFrom: Array<string>;
                                                                                                      collectTests: boolean;
                                                                                                      coverageDirectory: string;
                                                                                                      coveragePathIgnorePatterns?: Array<string>;
                                                                                                      coverageProvider: CoverageProvider;
                                                                                                      coverageReporters: CoverageReporters;
                                                                                                      coverageThreshold?: CoverageThreshold;
                                                                                                      detectLeaks: boolean;
                                                                                                      detectOpenHandles: boolean;
                                                                                                      expand: boolean;
                                                                                                      filter?: string;
                                                                                                      findRelatedTests: boolean;
                                                                                                      forceExit: boolean;
                                                                                                      json: boolean;
                                                                                                      globalSetup?: string;
                                                                                                      globalTeardown?: string;
                                                                                                      lastCommit: boolean;
                                                                                                      logHeapUsage: boolean;
                                                                                                      listTests: boolean;
                                                                                                      maxConcurrency: number;
                                                                                                      maxWorkers: number;
                                                                                                      noStackTrace: boolean;
                                                                                                      nonFlagArgs: Array<string>;
                                                                                                      noSCM?: boolean;
                                                                                                      notify: boolean;
                                                                                                      notifyMode: NotifyMode;
                                                                                                      outputFile?: string;
                                                                                                      onlyChanged: boolean;
                                                                                                      onlyFailures: boolean;
                                                                                                      openHandlesTimeout: number;
                                                                                                      passWithNoTests: boolean;
                                                                                                      projects: Array<string>;
                                                                                                      randomize?: boolean;
                                                                                                      replname?: string;
                                                                                                      reporters?: Array<ReporterConfig>;
                                                                                                      runInBand: boolean;
                                                                                                      runTestsByPath: boolean;
                                                                                                      rootDir: string;
                                                                                                      seed: number;
                                                                                                      showSeed?: boolean;
                                                                                                      shard?: ShardConfig;
                                                                                                      silent?: boolean;
                                                                                                      skipFilter: boolean;
                                                                                                      snapshotFormat: SnapshotFormat;
                                                                                                      errorOnDeprecated: boolean;
                                                                                                      testFailureExitCode: number;
                                                                                                      testNamePattern?: string;
                                                                                                      testPathPatterns: TestPathPatterns;
                                                                                                      testResultsProcessor?: string;
                                                                                                      testSequencer: string;
                                                                                                      testTimeout?: number;
                                                                                                      updateSnapshot: SnapshotUpdateState;
                                                                                                      useStderr: boolean;
                                                                                                      verbose?: boolean;
                                                                                                      waitForUnhandledRejections: boolean;
                                                                                                      watch: boolean;
                                                                                                      watchAll: boolean;
                                                                                                      watchman: boolean;
                                                                                                      watchPlugins?: Array<{
                                                                                                      path: string;
                                                                                                      config: Record<string, unknown>;
                                                                                                      }> | null;
                                                                                                      workerGracefulExitTimeout?: number;
                                                                                                      workerIdleMemoryLimit?: number;
                                                                                                      workerThreads?: boolean;
                                                                                                      };

                                                                                                        type GlobalFakeTimersConfig

                                                                                                        type GlobalFakeTimersConfig = {
                                                                                                        /**
                                                                                                        * Whether fake timers should be enabled globally for all test files.
                                                                                                        *
                                                                                                        * @defaultValue
                                                                                                        * The default is `false`.
                                                                                                        */
                                                                                                        enableGlobally?: boolean;
                                                                                                        };

                                                                                                          type HasteConfig

                                                                                                          type HasteConfig = {
                                                                                                          /** Whether to hash files using SHA-1. */
                                                                                                          computeSha1?: boolean;
                                                                                                          /** The platform to use as the default, e.g. 'ios'. */
                                                                                                          defaultPlatform?: string | null;
                                                                                                          /** Force use of Node's `fs` APIs rather than shelling out to `find` */
                                                                                                          forceNodeFilesystemAPI?: boolean;
                                                                                                          /**
                                                                                                          * Whether to follow symlinks when crawling for files.
                                                                                                          * This option cannot be used in projects which use watchman.
                                                                                                          * Projects with `watchman` set to true will error if this option is set to true.
                                                                                                          */
                                                                                                          enableSymlinks?: boolean;
                                                                                                          /** string to a custom implementation of Haste. */
                                                                                                          hasteImplModulePath?: string;
                                                                                                          /** All platforms to target, e.g ['ios', 'android']. */
                                                                                                          platforms?: Array<string>;
                                                                                                          /** Whether to throw an error on module collision. */
                                                                                                          throwOnModuleCollision?: boolean;
                                                                                                          /** Custom HasteMap module */
                                                                                                          hasteMapModulePath?: string;
                                                                                                          /** Whether to retain all files, allowing e.g. search for tests in `node_modules`. */
                                                                                                          retainAllFiles?: boolean;
                                                                                                          };

                                                                                                            type InitialOptionsWithRootDir

                                                                                                            type InitialOptionsWithRootDir = InitialOptions &
                                                                                                            Required<Pick<InitialOptions, 'rootDir'>>;

                                                                                                              type InitialProjectOptions

                                                                                                              type InitialProjectOptions = Pick<
                                                                                                              InitialOptions,
                                                                                                              Extract<keyof ProjectConfig, keyof InitialOptions>
                                                                                                              >;

                                                                                                                type LegacyFakeTimersConfig

                                                                                                                type LegacyFakeTimersConfig = {
                                                                                                                /**
                                                                                                                * Use the old fake timers implementation instead of one backed by
                                                                                                                * [`@sinonjs/fake-timers`](https://github.com/sinonjs/fake-timers).
                                                                                                                *
                                                                                                                * @defaultValue
                                                                                                                * The default is `false`.
                                                                                                                */
                                                                                                                legacyFakeTimers?: true;
                                                                                                                };

                                                                                                                  type ProjectConfig

                                                                                                                  type ProjectConfig = {
                                                                                                                  automock: boolean;
                                                                                                                  cache: boolean;
                                                                                                                  cacheDirectory: string;
                                                                                                                  clearMocks: boolean;
                                                                                                                  collectCoverage: boolean;
                                                                                                                  collectCoverageFrom: Array<string>;
                                                                                                                  coverageDirectory: string;
                                                                                                                  coveragePathIgnorePatterns: Array<string>;
                                                                                                                  coverageProvider: CoverageProvider;
                                                                                                                  cwd: string;
                                                                                                                  dependencyExtractor?: string;
                                                                                                                  detectLeaks: boolean;
                                                                                                                  detectOpenHandles: boolean;
                                                                                                                  displayName?: DisplayName;
                                                                                                                  errorOnDeprecated: boolean;
                                                                                                                  extensionsToTreatAsEsm: Array<string>;
                                                                                                                  fakeTimers: FakeTimers;
                                                                                                                  filter?: string;
                                                                                                                  forceCoverageMatch: Array<string>;
                                                                                                                  globalSetup?: string;
                                                                                                                  globalTeardown?: string;
                                                                                                                  globals: ConfigGlobals;
                                                                                                                  haste: HasteConfig;
                                                                                                                  id: string;
                                                                                                                  injectGlobals: boolean;
                                                                                                                  moduleDirectories: Array<string>;
                                                                                                                  moduleFileExtensions: Array<string>;
                                                                                                                  moduleNameMapper: Array<[string, string]>;
                                                                                                                  modulePathIgnorePatterns: Array<string>;
                                                                                                                  modulePaths?: Array<string>;
                                                                                                                  openHandlesTimeout: number;
                                                                                                                  preset?: string;
                                                                                                                  prettierPath: string;
                                                                                                                  resetMocks: boolean;
                                                                                                                  resetModules: boolean;
                                                                                                                  resolver?: string;
                                                                                                                  restoreMocks: boolean;
                                                                                                                  rootDir: string;
                                                                                                                  roots: Array<string>;
                                                                                                                  runner: string;
                                                                                                                  runnerOptions: Record<string, unknown>;
                                                                                                                  runtime?: string;
                                                                                                                  sandboxInjectedGlobals: Array<keyof typeof globalThis>;
                                                                                                                  setupFiles: Array<string>;
                                                                                                                  setupFilesAfterEnv: Array<string>;
                                                                                                                  silent?: boolean;
                                                                                                                  skipFilter: boolean;
                                                                                                                  skipNodeResolution?: boolean;
                                                                                                                  slowTestThreshold: number;
                                                                                                                  snapshotResolver?: string;
                                                                                                                  snapshotSerializers: Array<string>;
                                                                                                                  snapshotFormat: SnapshotFormat;
                                                                                                                  testEnvironment: string;
                                                                                                                  testEnvironmentOptions: Record<string, unknown>;
                                                                                                                  testMatch: Array<string>;
                                                                                                                  testLocationInResults: boolean;
                                                                                                                  testPathIgnorePatterns: Array<string>;
                                                                                                                  testRegex: Array<string | RegExp>;
                                                                                                                  testRunner: string;
                                                                                                                  testTimeout: number;
                                                                                                                  transform: Array<[string, string, Record<string, unknown>]>;
                                                                                                                  transformIgnorePatterns: Array<string>;
                                                                                                                  watchPathIgnorePatterns: Array<string>;
                                                                                                                  unmockedModulePathPatterns?: Array<string>;
                                                                                                                  verbose?: boolean;
                                                                                                                  waitForUnhandledRejections: boolean;
                                                                                                                  };

                                                                                                                    type ReporterConfig

                                                                                                                    type ReporterConfig = [string, Record<string, unknown>];

                                                                                                                      type SetupAfterEnvPerfStats

                                                                                                                      type SetupAfterEnvPerfStats = {
                                                                                                                      setupAfterEnvStart: number;
                                                                                                                      setupAfterEnvEnd: number;
                                                                                                                      };

                                                                                                                        type SnapshotUpdateState

                                                                                                                        type SnapshotUpdateState = 'all' | 'new' | 'none';

                                                                                                                          type TransformerConfig

                                                                                                                          type TransformerConfig = [string, Record<string, unknown>];

                                                                                                                            namespace Global

                                                                                                                            namespace Global {}

                                                                                                                              interface Describe

                                                                                                                              interface Describe extends DescribeBase {}

                                                                                                                                property only

                                                                                                                                only: DescribeBase;

                                                                                                                                  property skip

                                                                                                                                  skip: DescribeBase;

                                                                                                                                    interface DescribeBase

                                                                                                                                    interface DescribeBase {}

                                                                                                                                      property each

                                                                                                                                      each: Each<BlockFn>;

                                                                                                                                        call signature

                                                                                                                                        (blockName: BlockNameLike, blockFn: BlockFn): void;

                                                                                                                                          interface Failing

                                                                                                                                          interface Failing<T extends TestFn> {}

                                                                                                                                            property each

                                                                                                                                            each: Each<T>;

                                                                                                                                              call signature

                                                                                                                                              (testName: TestNameLike, fn: T, timeout?: number): void;

                                                                                                                                                interface Global

                                                                                                                                                interface Global_3
                                                                                                                                                extends GlobalAdditions,
                                                                                                                                                Omit<typeof globalThis, keyof GlobalAdditions> {}

                                                                                                                                                  index signature

                                                                                                                                                  [extras: PropertyKey]: unknown;

                                                                                                                                                    interface GlobalAdditions

                                                                                                                                                    interface GlobalAdditions extends TestFrameworkGlobals {}

                                                                                                                                                      interface It

                                                                                                                                                      interface It extends ItBase {}

                                                                                                                                                        property only

                                                                                                                                                        only: ItBase;

                                                                                                                                                          property skip

                                                                                                                                                          skip: ItBase;

                                                                                                                                                            property todo

                                                                                                                                                            todo: (testName: TestNameLike) => void;

                                                                                                                                                              interface ItBase

                                                                                                                                                              interface ItBase {}

                                                                                                                                                                property each

                                                                                                                                                                each: Each<TestFn>;

                                                                                                                                                                  property failing

                                                                                                                                                                  failing: Failing<TestFn>;

                                                                                                                                                                    call signature

                                                                                                                                                                    (testName: TestNameLike, fn: TestFn, timeout?: number): void;

                                                                                                                                                                      interface ItConcurrent

                                                                                                                                                                      interface ItConcurrent extends It {}

                                                                                                                                                                        property concurrent

                                                                                                                                                                        concurrent: ItConcurrentExtended;

                                                                                                                                                                          interface ItConcurrentBase

                                                                                                                                                                          interface ItConcurrentBase {}

                                                                                                                                                                            property each

                                                                                                                                                                            each: Each<ConcurrentTestFn>;

                                                                                                                                                                              property failing

                                                                                                                                                                              failing: Failing<ConcurrentTestFn>;

                                                                                                                                                                                call signature

                                                                                                                                                                                (testName: TestNameLike, testFn: ConcurrentTestFn, timeout?: number): void;

                                                                                                                                                                                  interface ItConcurrentExtended

                                                                                                                                                                                  interface ItConcurrentExtended extends ItConcurrentBase {}

                                                                                                                                                                                    property only

                                                                                                                                                                                    only: ItConcurrentBase;

                                                                                                                                                                                      property skip

                                                                                                                                                                                      skip: ItConcurrentBase;

                                                                                                                                                                                        interface TestFrameworkGlobals

                                                                                                                                                                                        interface TestFrameworkGlobals {}

                                                                                                                                                                                          property afterAll

                                                                                                                                                                                          afterAll: HookBase;

                                                                                                                                                                                            property afterEach

                                                                                                                                                                                            afterEach: HookBase;

                                                                                                                                                                                              property beforeAll

                                                                                                                                                                                              beforeAll: HookBase;

                                                                                                                                                                                                property beforeEach

                                                                                                                                                                                                beforeEach: HookBase;

                                                                                                                                                                                                  property describe

                                                                                                                                                                                                  describe: Describe;

                                                                                                                                                                                                    property fdescribe

                                                                                                                                                                                                    fdescribe: DescribeBase;

                                                                                                                                                                                                      property fit

                                                                                                                                                                                                      fit: ItBase & {
                                                                                                                                                                                                      concurrent?: ItConcurrentBase;
                                                                                                                                                                                                      };

                                                                                                                                                                                                        property it

                                                                                                                                                                                                        it: ItConcurrent;

                                                                                                                                                                                                          property test

                                                                                                                                                                                                          test: ItConcurrent;

                                                                                                                                                                                                            property xdescribe

                                                                                                                                                                                                            xdescribe: DescribeBase;

                                                                                                                                                                                                              property xit

                                                                                                                                                                                                              xit: ItBase;

                                                                                                                                                                                                                property xtest

                                                                                                                                                                                                                xtest: ItBase;

                                                                                                                                                                                                                  type ArrayTable

                                                                                                                                                                                                                  type ArrayTable = Table | Row;

                                                                                                                                                                                                                    type BlockFn

                                                                                                                                                                                                                    type BlockFn = () => void;

                                                                                                                                                                                                                      type BlockName

                                                                                                                                                                                                                      type BlockName = string;

                                                                                                                                                                                                                        type BlockNameLike

                                                                                                                                                                                                                        type BlockNameLike = BlockName | NameLike;

                                                                                                                                                                                                                          type Col

                                                                                                                                                                                                                          type Col = unknown;

                                                                                                                                                                                                                            type ConcurrentTestFn

                                                                                                                                                                                                                            type ConcurrentTestFn = () => TestReturnValuePromise;

                                                                                                                                                                                                                              type DoneFn

                                                                                                                                                                                                                              type DoneFn_2 = (reason?: string | Error) => void;

                                                                                                                                                                                                                                type DoneTakingTestFn

                                                                                                                                                                                                                                type DoneTakingTestFn = (this: TestContext, done: DoneFn_2) => ValidTestReturnValues;

                                                                                                                                                                                                                                  type EachTable

                                                                                                                                                                                                                                  type EachTable = ArrayTable | TemplateTable;

                                                                                                                                                                                                                                    type EachTestFn

                                                                                                                                                                                                                                    type EachTestFn<EachCallback extends TestCallback> = (
                                                                                                                                                                                                                                    ...args: ReadonlyArray<any>
                                                                                                                                                                                                                                    ) => ReturnType<EachCallback>;

                                                                                                                                                                                                                                      type GeneratorReturningTestFn

                                                                                                                                                                                                                                      type GeneratorReturningTestFn = (this: TestContext) => TestReturnValueGenerator;

                                                                                                                                                                                                                                        type HookBase

                                                                                                                                                                                                                                        type HookBase = (fn: HookFn, timeout?: number) => void;

                                                                                                                                                                                                                                          type HookFn

                                                                                                                                                                                                                                          type HookFn = TestFn;

                                                                                                                                                                                                                                            type NameLike

                                                                                                                                                                                                                                            type NameLike = number | Function;

                                                                                                                                                                                                                                              type PromiseReturningTestFn

                                                                                                                                                                                                                                              type PromiseReturningTestFn = (this: TestContext) => TestReturnValue;

                                                                                                                                                                                                                                                type Row

                                                                                                                                                                                                                                                type Row = ReadonlyArray<Col>;

                                                                                                                                                                                                                                                  type Table

                                                                                                                                                                                                                                                  type Table = ReadonlyArray<Row>;

                                                                                                                                                                                                                                                    type TemplateData

                                                                                                                                                                                                                                                    type TemplateData = ReadonlyArray<unknown>;

                                                                                                                                                                                                                                                      type TemplateTable

                                                                                                                                                                                                                                                      type TemplateTable = TemplateStringsArray;

                                                                                                                                                                                                                                                        type TestCallback

                                                                                                                                                                                                                                                        type TestCallback = BlockFn | TestFn | ConcurrentTestFn;

                                                                                                                                                                                                                                                          type TestContext

                                                                                                                                                                                                                                                          type TestContext = Record<string, unknown>;

                                                                                                                                                                                                                                                            type TestFn

                                                                                                                                                                                                                                                            type TestFn = PromiseReturningTestFn | GeneratorReturningTestFn | DoneTakingTestFn;

                                                                                                                                                                                                                                                              type TestName

                                                                                                                                                                                                                                                              type TestName = string;

                                                                                                                                                                                                                                                                type TestNameLike

                                                                                                                                                                                                                                                                type TestNameLike = TestName | NameLike;

                                                                                                                                                                                                                                                                  type TestReturnValue

                                                                                                                                                                                                                                                                  type TestReturnValue = ValidTestReturnValues | TestReturnValuePromise;

                                                                                                                                                                                                                                                                    type ValidTestReturnValues

                                                                                                                                                                                                                                                                    type ValidTestReturnValues = void | undefined;

                                                                                                                                                                                                                                                                      namespace TestResult

                                                                                                                                                                                                                                                                      namespace TestResult {}

                                                                                                                                                                                                                                                                        type AssertionResult

                                                                                                                                                                                                                                                                        type AssertionResult = {
                                                                                                                                                                                                                                                                        ancestorTitles: Array<string>;
                                                                                                                                                                                                                                                                        duration?: number | null;
                                                                                                                                                                                                                                                                        startAt?: number | null;
                                                                                                                                                                                                                                                                        /**
                                                                                                                                                                                                                                                                        * Whether [`test.failing()`](https://jestjs.io/docs/api#testfailingname-fn-timeout)
                                                                                                                                                                                                                                                                        * was used.
                                                                                                                                                                                                                                                                        */
                                                                                                                                                                                                                                                                        failing?: boolean;
                                                                                                                                                                                                                                                                        /**
                                                                                                                                                                                                                                                                        * The raw values of the `function` or `symbol` types will be lost in some cases
                                                                                                                                                                                                                                                                        * because it's not possible to serialize them correctly between workers.
                                                                                                                                                                                                                                                                        * However, information about them will be available in the `failureMessages`.
                                                                                                                                                                                                                                                                        */
                                                                                                                                                                                                                                                                        failureDetails: Array<unknown>;
                                                                                                                                                                                                                                                                        failureMessages: Array<string>;
                                                                                                                                                                                                                                                                        fullName: string;
                                                                                                                                                                                                                                                                        invocations?: number;
                                                                                                                                                                                                                                                                        location?: Callsite | null;
                                                                                                                                                                                                                                                                        numPassingAsserts: number;
                                                                                                                                                                                                                                                                        /**
                                                                                                                                                                                                                                                                        * Human-readable render of `retryReasons`, formatted where the errors are
                                                                                                                                                                                                                                                                        * still live so nested causes and `AggregateError` entries survive worker
                                                                                                                                                                                                                                                                        * serialization.
                                                                                                                                                                                                                                                                        */
                                                                                                                                                                                                                                                                        retryMessages?: Array<string>;
                                                                                                                                                                                                                                                                        retryReasons?: Array<string>;
                                                                                                                                                                                                                                                                        status: Status;
                                                                                                                                                                                                                                                                        title: string;
                                                                                                                                                                                                                                                                        /**
                                                                                                                                                                                                                                                                        * Set by `jest --collectTests` on a test that was discovered as selected to
                                                                                                                                                                                                                                                                        * run but never executed. Distinguishes a test reported in the `passed`
                                                                                                                                                                                                                                                                        * bucket because it would run from one that actually passed.
                                                                                                                                                                                                                                                                        */
                                                                                                                                                                                                                                                                        wouldRun?: boolean;
                                                                                                                                                                                                                                                                        };

                                                                                                                                                                                                                                                                          type SerializableError

                                                                                                                                                                                                                                                                          type SerializableError = {
                                                                                                                                                                                                                                                                          code?: unknown;
                                                                                                                                                                                                                                                                          message: string;
                                                                                                                                                                                                                                                                          stack: string | null | undefined;
                                                                                                                                                                                                                                                                          type?: string;
                                                                                                                                                                                                                                                                          };

                                                                                                                                                                                                                                                                            namespace TransformTypes

                                                                                                                                                                                                                                                                            namespace TransformTypes {}

                                                                                                                                                                                                                                                                              interface CacheKeyOptions

                                                                                                                                                                                                                                                                              interface CacheKeyOptions extends ReducedTransformOptions {}
                                                                                                                                                                                                                                                                              • What a Transformer's cache key can depend on.

                                                                                                                                                                                                                                                                              property config

                                                                                                                                                                                                                                                                              config: Config.ProjectConfig;
                                                                                                                                                                                                                                                                              • Jest configuration of currently running project.

                                                                                                                                                                                                                                                                              property configString

                                                                                                                                                                                                                                                                              configString: string;
                                                                                                                                                                                                                                                                              • Stringified version of the config - useful in cache busting.

                                                                                                                                                                                                                                                                              interface CallerTransformOptions

                                                                                                                                                                                                                                                                              interface CallerTransformOptions {}

                                                                                                                                                                                                                                                                                property supportsDynamicImport

                                                                                                                                                                                                                                                                                supportsDynamicImport: boolean;

                                                                                                                                                                                                                                                                                  property supportsExportNamespaceFrom

                                                                                                                                                                                                                                                                                  supportsExportNamespaceFrom: boolean;

                                                                                                                                                                                                                                                                                    property supportsStaticESM

                                                                                                                                                                                                                                                                                    supportsStaticESM: boolean;

                                                                                                                                                                                                                                                                                      property supportsTopLevelAwait

                                                                                                                                                                                                                                                                                      supportsTopLevelAwait: boolean;

                                                                                                                                                                                                                                                                                        interface ReducedTransformOptions

                                                                                                                                                                                                                                                                                        interface ReducedTransformOptions extends CallerTransformOptions {}

                                                                                                                                                                                                                                                                                          property instrument

                                                                                                                                                                                                                                                                                          instrument: boolean;

                                                                                                                                                                                                                                                                                            interface TransformResult

                                                                                                                                                                                                                                                                                            interface TransformResult {}

                                                                                                                                                                                                                                                                                              property code

                                                                                                                                                                                                                                                                                              code: string;

                                                                                                                                                                                                                                                                                                property originalCode

                                                                                                                                                                                                                                                                                                originalCode: string;

                                                                                                                                                                                                                                                                                                  property sourceMapPath

                                                                                                                                                                                                                                                                                                  sourceMapPath: string | null;

                                                                                                                                                                                                                                                                                                    Package Files (1)

                                                                                                                                                                                                                                                                                                    Dependencies (7)

                                                                                                                                                                                                                                                                                                    Dev Dependencies (0)

                                                                                                                                                                                                                                                                                                    No dev dependencies.

                                                                                                                                                                                                                                                                                                    Peer Dependencies (0)

                                                                                                                                                                                                                                                                                                    No peer dependencies.

                                                                                                                                                                                                                                                                                                    Badge

                                                                                                                                                                                                                                                                                                    To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                                                                                                                                                                                                                    You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@jest/types.

                                                                                                                                                                                                                                                                                                    • Markdown
                                                                                                                                                                                                                                                                                                      [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@jest/types)
                                                                                                                                                                                                                                                                                                    • HTML
                                                                                                                                                                                                                                                                                                      <a href="https://www.jsdocs.io/package/@jest/types"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>