NPM Build Utilities @ 0.3.0-alpha.9
    Preparing search index...

    Function jestConfig

    • Returns a default jest config object with optional overrides.

      Type Parameters

      • T_Overrides extends
            | {
                automock?: boolean;
                bail?: number
                | boolean;
                cache?: boolean;
                cacheDirectory?: string;
                changedFilesWithAncestor?: boolean;
                changedSince?: string;
                ci?: boolean;
                clearMocks?: boolean;
                collectCoverage?: boolean;
                collectCoverageFrom?: string[];
                coverageDirectory?: string;
                coveragePathIgnorePatterns?: string[];
                coverageProvider?: "babel" | "v8";
                coverageReporters?: (
                    | "html"
                    | "json"
                    | "none"
                    | "clover"
                    | "cobertura"
                    | "html-spa"
                    | "json-summary"
                    | "lcov"
                    | "lcovonly"
                    | "teamcity"
                    | "text"
                    | "text-lcov"
                    | "text-summary"
                    | [
                        | "html"
                        | "json"
                        | "none"
                        | "clover"
                        | "cobertura"
                        | "html-spa"
                        | "json-summary"
                        | "lcov"
                        | "lcovonly"
                        | "teamcity"
                        | "text"
                        | "text-lcov"
                        | "text-summary",
                        { [key: string]: unknown },
                    ]
                )[];
                coverageThreshold?: {
                    global: {
                        branches?: number;
                        functions?: number;
                        lines?: number;
                        statements?: number;
                    };
                    [path: string]: {
                        branches?: number;
                        functions?: number;
                        lines?: number;
                        statements?: number;
                    };
                };
                dependencyExtractor?: string;
                detectLeaks?: boolean;
                detectOpenHandles?: boolean;
                displayName?: | string
                | {
                    color: | "red"
                    | "yellow"
                    | "green"
                    | "blue"
                    | "grey"
                    | "black"
                    | "magenta"
                    | "cyan"
                    | "white"
                    | "gray"
                    | "blackBright"
                    | "redBright"
                    | "greenBright"
                    | "yellowBright"
                    | "blueBright"
                    | "magentaBright"
                    | "cyanBright"
                    | "whiteBright";
                    name: string;
                };
                errorOnDeprecated?: boolean;
                expand?: boolean;
                extensionsToTreatAsEsm?: string[];
                fakeTimers?: { enableGlobally?: boolean | undefined; } & ({ advanceTimers?: number | boolean | undefined; doNotFake?: ("Date" | "hrtime" | "nextTick" | "performance" | "queueMicrotask" | "requestAnimationFrame" | ... 8 more ... | "clearTimeout")[] | undefined; now?: number | undefined; timerLimit?: number | undefined; legacyFake...;
                filter?: string;
                findRelatedTests?: boolean;
                forceCoverageMatch?: string[];
                forceExit?: boolean;
                globals?: { [key: string]: unknown };
                globalSetup?: string | null;
                globalTeardown?: string | null;
                haste?: {
                    computeSha1?: boolean;
                    defaultPlatform?: string | null;
                    enableSymlinks?: boolean;
                    forceNodeFilesystemAPI?: boolean;
                    hasteImplModulePath?: string;
                    hasteMapModulePath?: string;
                    platforms?: string[];
                    retainAllFiles?: boolean;
                    throwOnModuleCollision?: boolean;
                };
                id?: string;
                injectGlobals?: boolean;
                json?: boolean;
                lastCommit?: boolean;
                listTests?: boolean;
                logHeapUsage?: boolean;
                maxConcurrency?: number;
                maxWorkers?: string
                | number;
                moduleDirectories?: string[];
                moduleFileExtensions?: string[];
                moduleNameMapper?: { [key: string]: string | string[] };
                modulePathIgnorePatterns?: string[];
                modulePaths?: string[];
                noStackTrace?: boolean;
                notify?: boolean;
                notifyMode?: string;
                onlyChanged?: boolean;
                onlyFailures?: boolean;
                openHandlesTimeout?: number;
                outputFile?: string;
                passWithNoTests?: boolean;
                preset?: string | null;
                prettierPath?: string | null;
                projects?: (string | { [key: string]: unknown })[];
                randomize?: boolean;
                replname?: string | null;
                reporters?: (string | [string, { [key: string]: unknown }])[];
                resetMocks?: boolean;
                resetModules?: boolean;
                resolver?: string | null;
                restoreMocks?: boolean;
                rootDir?: string;
                roots?: string[];
                runner?: string;
                runTestsByPath?: boolean;
                runtime?: string;
                sandboxInjectedGlobals?: string[];
                setupFiles?: string[];
                setupFilesAfterEnv?: string[];
                showSeed?: boolean;
                silent?: boolean;
                skipFilter?: boolean;
                skipNodeResolution?: boolean;
                slowTestThreshold?: number;
                snapshotFormat?: {
                    callToJSON?: boolean;
                    compareKeys?: null;
                    escapeRegex?: boolean;
                    escapeString?: boolean;
                    highlight?: boolean;
                    indent?: number;
                    maxDepth?: number;
                    maxWidth?: number;
                    min?: boolean;
                    printBasicPrototype?: boolean;
                    printFunctionName?: boolean;
                    theme?: {
                        comment?: string;
                        content?: string;
                        prop?: string;
                        tag?: string;
                        value?: string;
                    };
                };
                snapshotResolver?: string;
                snapshotSerializers?: string[];
                testEnvironment?: string;
                testEnvironmentOptions?: { [key: string]: unknown };
                testFailureExitCode?: number;
                testLocationInResults?: boolean;
                testMatch?: string | string[];
                testNamePattern?: string;
                testPathIgnorePatterns?: string[];
                testRegex?: string | string[];
                testResultsProcessor?: string;
                testRunner?: string;
                testSequencer?: string;
                testTimeout?: number;
                transform?: { [key: string]: string | [string, unknown] };
                transformIgnorePatterns?: string[];
                unmockedModulePathPatterns?: string[];
                updateSnapshot?: boolean;
                useStderr?: boolean;
                verbose?: boolean;
                waitForUnhandledRejections?: boolean;
                watch?: boolean;
                watchAll?: boolean;
                watchman?: boolean;
                watchPathIgnorePatterns?: string[];
                watchPlugins?: (string | [string, unknown])[];
                workerIdleMemoryLimit?: string | number;
                workerThreads?: boolean;
            }
            | undefined

      Parameters

      Returns {
          coveragePathIgnorePatterns: [
              "(^|/).scripts/",
              "(^|/).snapshots/",
              "(^|/)@releases/",
              "(^|/)docs/",
              "(^|/)node_modules/",
              "(^|/)src/",
              "(^|/)._.+",
          ];
          coverageProvider: "v8";
          notify: false;
          notifyMode: "failure-change";
          testMatch: ["**/?(*.)+(test).js?(x)"];
          testPathIgnorePatterns: [
              "(^|\\/).snapshots\\/",
              "(^|\\/)@releases\\/",
              "(^|\\/)demos\\/",
              "(^|\\/)docs\\/",
              "(^|\\/)node_modules\\/",
              "(^|\\/)\\._.+",
          ];
          transform: {};
      } & T_Overrides

      0.3.0-alpha.9