Class JestConfigOptions.Jsii$Proxy

    • Constructor Detail

      • Jsii$Proxy

        protected Jsii$Proxy​(software.amazon.jsii.JsiiObjectRef objRef)
        Constructor that initializes the object based on values retrieved from the JsiiObject.
        Parameters:
        objRef - Reference to the JSII managed object.
    • Method Detail

      • getAutomock

        public final Boolean getAutomock()
        Description copied from interface: JestConfigOptions
        (experimental) This option tells Jest that all imported modules in your tests should be mocked automatically.

        All modules used in your tests will have a replacement implementation, keeping the API surface

        Default: - false

        Specified by:
        getAutomock in interface JestConfigOptions
      • getBail

        public final Object getBail()
        Description copied from interface: JestConfigOptions
        (experimental) By default, Jest runs all tests and produces all errors into the console upon completion.

        The bail config option can be used here to have Jest stop running tests after n failures. Setting bail to true is the same as setting bail to 1.

        Default: - 0

        Specified by:
        getBail in interface JestConfigOptions
      • getCacheDirectory

        public final String getCacheDirectory()
        Description copied from interface: JestConfigOptions
        (experimental) The directory where Jest should store its cached dependency information.

        Default: - "/tmp/"

        Specified by:
        getCacheDirectory in interface JestConfigOptions
      • getClearMocks

        public final Boolean getClearMocks()
        Description copied from interface: JestConfigOptions
        (experimental) Automatically clear mock calls and instances before every test.

        Equivalent to calling jest.clearAllMocks() before each test. This does not remove any mock implementation that may have been provided

        Default: true

        Specified by:
        getClearMocks in interface JestConfigOptions
      • getCollectCoverage

        public final Boolean getCollectCoverage()
        Description copied from interface: JestConfigOptions
        (experimental) Indicates whether the coverage information should be collected while executing the test.

        Because this retrofits all executed files with coverage collection statements, it may significantly slow down your tests

        Default: true

        Specified by:
        getCollectCoverage in interface JestConfigOptions
      • getCollectCoverageFrom

        public final List<String> getCollectCoverageFrom()
        Description copied from interface: JestConfigOptions
        (experimental) An array of glob patterns indicating a set of files for which coverage information should be collected.

        Default: - undefined

        Specified by:
        getCollectCoverageFrom in interface JestConfigOptions
      • getCoveragePathIgnorePatterns

        public final List<String> getCoveragePathIgnorePatterns()
        Description copied from interface: JestConfigOptions
        (experimental) An array of regexp pattern strings that are matched against all file paths before executing the test.

        If the file path matches any of the patterns, coverage information will be skipped

        Default: "/node_modules/"

        Specified by:
        getCoveragePathIgnorePatterns in interface JestConfigOptions
      • getCoverageProvider

        public final String getCoverageProvider()
        Description copied from interface: JestConfigOptions
        (experimental) Indicates which provider should be used to instrument code for coverage.

        Allowed values are babel (default) or v8

        Default: - "babel"

        Specified by:
        getCoverageProvider in interface JestConfigOptions
      • getCoverageReporters

        public final List<String> getCoverageReporters()
        Description copied from interface: JestConfigOptions
        (experimental) A list of reporter names that Jest uses when writing coverage reports.

        Any istanbul reporter can be used

        Default: - ["json", "lcov", "text", "clover", "cobertura"]

        Specified by:
        getCoverageReporters in interface JestConfigOptions
      • getCoverageThreshold

        public final CoverageThreshold getCoverageThreshold()
        Description copied from interface: JestConfigOptions
        (experimental) Specify the global coverage thresholds.

        This will be used to configure minimum threshold enforcement for coverage results. Thresholds can be specified as global, as a glob, and as a directory or file path. If thresholds aren't met, jest will fail.

        Default: - undefined

        Specified by:
        getCoverageThreshold in interface JestConfigOptions
      • getDependencyExtractor

        public final String getDependencyExtractor()
        Description copied from interface: JestConfigOptions
        (experimental) This option allows the use of a custom dependency extractor.

        It must be a node module that exports an object with an extract function

        Default: - undefined

        Specified by:
        getDependencyExtractor in interface JestConfigOptions
      • getDisplayName

        public final Object getDisplayName()
        Description copied from interface: JestConfigOptions
        (experimental) Allows for a label to be printed alongside a test while it is running.

        Default: - undefined

        Specified by:
        getDisplayName in interface JestConfigOptions
      • getErrorOnDeprecated

        public final Boolean getErrorOnDeprecated()
        Description copied from interface: JestConfigOptions
        (experimental) Make calling deprecated APIs throw helpful error messages.

        Useful for easing the upgrade process.

        Default: - false

        Specified by:
        getErrorOnDeprecated in interface JestConfigOptions
      • getExtraGlobals

        public final List<String> getExtraGlobals()
        Description copied from interface: JestConfigOptions
        (experimental) Test files run inside a vm, which slows calls to global context properties (e.g. Math). With this option you can specify extra properties to be defined inside the vm for faster lookups.

        Default: - undefined

        Specified by:
        getExtraGlobals in interface JestConfigOptions
      • getForceCoverageMatch

        public final List<String> getForceCoverageMatch()
        Description copied from interface: JestConfigOptions
        (experimental) Test files are normally ignored from collecting code coverage.

        With this option, you can overwrite this behavior and include otherwise ignored files in code coverage.

        Default: - ['']

        Specified by:
        getForceCoverageMatch in interface JestConfigOptions
      • getGlobals

        public final Object getGlobals()
        Description copied from interface: JestConfigOptions
        (experimental) A set of global variables that need to be available in all test environments.

        Default: - {}

        Specified by:
        getGlobals in interface JestConfigOptions
      • getGlobalSetup

        public final String getGlobalSetup()
        Description copied from interface: JestConfigOptions
        (experimental) This option allows the use of a custom global setup module which exports an async function that is triggered once before all test suites.

        This function gets Jest's globalConfig object as a parameter.

        Default: - undefined

        Specified by:
        getGlobalSetup in interface JestConfigOptions
      • getGlobalTeardown

        public final String getGlobalTeardown()
        Description copied from interface: JestConfigOptions
        (experimental) This option allows the use of a custom global teardown module which exports an async function that is triggered once after all test suites.

        This function gets Jest's globalConfig object as a parameter.

        Default: - undefined

        Specified by:
        getGlobalTeardown in interface JestConfigOptions
      • getHaste

        public final HasteConfig getHaste()
        Description copied from interface: JestConfigOptions
        (experimental) This will be used to configure the behavior of jest-haste-map, Jest's internal file crawler/cache system.

        Default: - {}

        Specified by:
        getHaste in interface JestConfigOptions
      • getInjectGlobals

        public final Boolean getInjectGlobals()
        Description copied from interface: JestConfigOptions
        (experimental) Insert Jest's globals (expect, test, describe, beforeEach etc.) into the global environment. If you set this to false, you should import from.

        Default: - true

        Specified by:
        getInjectGlobals in interface JestConfigOptions
      • getMaxConcurrency

        public final Number getMaxConcurrency()
        Description copied from interface: JestConfigOptions
        (experimental) A number limiting the number of tests that are allowed to run at the same time when using test.concurrent. Any test above this limit will be queued and executed once a slot is released.

        Default: - 5

        Specified by:
        getMaxConcurrency in interface JestConfigOptions
      • getMaxWorkers

        public final Object getMaxWorkers()
        Description copied from interface: JestConfigOptions
        (experimental) Specifies the maximum number of workers the worker-pool will spawn for running tests.

        In single run mode, this defaults to the number of the cores available on your machine minus one for the main thread In watch mode, this defaults to half of the available cores on your machine. For environments with variable CPUs available, you can use percentage based configuration: "maxWorkers": "50%"

        Default: - the number of the cores available on your machine minus one for the main thread

        Specified by:
        getMaxWorkers in interface JestConfigOptions
      • getModuleDirectories

        public final List<String> getModuleDirectories()
        Description copied from interface: JestConfigOptions
        (experimental) An array of directory names to be searched recursively up from the requiring module's location.

        Setting this option will override the default, if you wish to still search node_modules for packages include it along with any other options: ["node_modules", "bower_components"]

        Default: - ["node_modules"]

        Specified by:
        getModuleDirectories in interface JestConfigOptions
      • getModuleFileExtensions

        public final List<String> getModuleFileExtensions()
        Description copied from interface: JestConfigOptions
        (experimental) An array of file extensions your modules use.

        If you require modules without specifying a file extension, these are the extensions Jest will look for, in left-to-right order.

        Default: - ["js", "json", "jsx", "ts", "tsx", "node"]

        Specified by:
        getModuleFileExtensions in interface JestConfigOptions
      • getModuleNameMapper

        public final Map<String,​Object> getModuleNameMapper()
        Description copied from interface: JestConfigOptions
        (experimental) A map from regular expressions to module names or to arrays of module names that allow to stub out resources, like images or styles with a single module.

        Default: - null

        Specified by:
        getModuleNameMapper in interface JestConfigOptions
      • getModulePathIgnorePatterns

        public final List<String> getModulePathIgnorePatterns()
        Description copied from interface: JestConfigOptions
        (experimental) An array of regexp pattern strings that are matched against all module paths before those paths are to be considered 'visible' to the module loader.

        If a given module's path matches any of the patterns, it will not be require()-able in the test environment.

        Default: - []

        Specified by:
        getModulePathIgnorePatterns in interface JestConfigOptions
      • getModulePaths

        public final List<String> getModulePaths()
        Description copied from interface: JestConfigOptions
        (experimental) An alternative API to setting the NODE_PATH env variable, modulePaths is an array of absolute paths to additional locations to search when resolving modules.

        Use the string token to include the path to your project's root directory. Example: ["/app/"].

        Default: - []

        Specified by:
        getModulePaths in interface JestConfigOptions
      • getPreset

        public final String getPreset()
        Description copied from interface: JestConfigOptions
        (experimental) A preset that is used as a base for Jest's configuration.

        A preset should point to an npm module that has a jest-preset.json or jest-preset.js file at the root.

        Default: - undefined

        Specified by:
        getPreset in interface JestConfigOptions
      • getPrettierPath

        public final String getPrettierPath()
        Description copied from interface: JestConfigOptions
        (experimental) Sets the path to the prettier node module used to update inline snapshots.

        Default: - "prettier"

        Specified by:
        getPrettierPath in interface JestConfigOptions
      • getProjects

        public final List<Object> getProjects()
        Description copied from interface: JestConfigOptions
        (experimental) When the projects configuration is provided with an array of paths or glob patterns, Jest will run tests in all of the specified projects at the same time.

        This is great for monorepos or when working on multiple projects at the same time.

        Default: - undefined

        Specified by:
        getProjects in interface JestConfigOptions
      • getReporters

        public final List<JestReporter> getReporters()
        Description copied from interface: JestConfigOptions
        (experimental) Use this configuration option to add custom reporters to Jest.

        A custom reporter is a class that implements onRunStart, onTestStart, onTestResult, onRunComplete methods that will be called when any of those events occurs.

        Default: - undefined

        Specified by:
        getReporters in interface JestConfigOptions
      • getResetMocks

        public final Boolean getResetMocks()
        Description copied from interface: JestConfigOptions
        (experimental) Automatically reset mock state before every test.

        Equivalent to calling jest.resetAllMocks() before each test. This will lead to any mocks having their fake implementations removed but does not restore their initial implementation.

        Default: - false

        Specified by:
        getResetMocks in interface JestConfigOptions
      • getResetModules

        public final Boolean getResetModules()
        Description copied from interface: JestConfigOptions
        (experimental) By default, each test file gets its own independent module registry.

        Enabling resetModules goes a step further and resets the module registry before running each individual test.

        Default: - false

        Specified by:
        getResetModules in interface JestConfigOptions
      • getResolver

        public final String getResolver()
        Description copied from interface: JestConfigOptions
        (experimental) This option allows the use of a custom resolver.

        https://jestjs.io/docs/en/configuration#resolver-string

        Default: - undefined

        Specified by:
        getResolver in interface JestConfigOptions
      • getRestoreMocks

        public final Boolean getRestoreMocks()
        Description copied from interface: JestConfigOptions
        (experimental) Automatically restore mock state before every test.

        Equivalent to calling jest.restoreAllMocks() before each test. This will lead to any mocks having their fake implementations removed and restores their initial implementation.

        Default: - false

        Specified by:
        getRestoreMocks in interface JestConfigOptions
      • getRootDir

        public final String getRootDir()
        Description copied from interface: JestConfigOptions
        (experimental) The root directory that Jest should scan for tests and modules within.

        If you put your Jest config inside your package.json and want the root directory to be the root of your repo, the value for this config param will default to the directory of the package.json.

        Default: - directory of the package.json

        Specified by:
        getRootDir in interface JestConfigOptions
      • getRoots

        public final List<String> getRoots()
        Description copied from interface: JestConfigOptions
        (experimental) A list of paths to directories that Jest should use to search for files in.

        Default: - [""]

        Specified by:
        getRoots in interface JestConfigOptions
      • getRunner

        public final String getRunner()
        Description copied from interface: JestConfigOptions
        (experimental) This option allows you to use a custom runner instead of Jest's default test runner.

        Default: - "jest-runner"

        Specified by:
        getRunner in interface JestConfigOptions
      • getSetupFiles

        public final List<String> getSetupFiles()
        Description copied from interface: JestConfigOptions
        (experimental) A list of paths to modules that run some code to configure or set up the testing environment.

        Each setupFile will be run once per test file. Since every test runs in its own environment, these scripts will be executed in the testing environment immediately before executing the test code itself.

        Default: - []

        Specified by:
        getSetupFiles in interface JestConfigOptions
      • getSetupFilesAfterEnv

        public final List<String> getSetupFilesAfterEnv()
        Description copied from interface: JestConfigOptions
        (experimental) A list of paths to modules that run some code to configure or set up the testing framework before each test file in the suite is executed.

        Since setupFiles executes before the test framework is installed in the environment, this script file presents you the opportunity of running some code immediately after the test framework has been installed in the environment.

        Default: - []

        Specified by:
        getSetupFilesAfterEnv in interface JestConfigOptions
      • getSlowTestThreshold

        public final Number getSlowTestThreshold()
        Description copied from interface: JestConfigOptions
        (experimental) The number of seconds after which a test is considered as slow and reported as such in the results.

        Default: - 5

        Specified by:
        getSlowTestThreshold in interface JestConfigOptions
      • getSnapshotResolver

        public final String getSnapshotResolver()
        Description copied from interface: JestConfigOptions
        (experimental) The path to a module that can resolve test<->snapshot path.

        This config option lets you customize where Jest stores snapshot files on disk.

        Default: - undefined

        Specified by:
        getSnapshotResolver in interface JestConfigOptions
      • getTestEnvironment

        public final String getTestEnvironment()
        Description copied from interface: JestConfigOptions
        (experimental) The test environment that will be used for testing.

        The default environment in Jest is a browser-like environment through jsdom. If you are building a node service, you can use the node option to use a node-like environment instead.

        Default: - "jsdom"

        Specified by:
        getTestEnvironment in interface JestConfigOptions
      • getTestEnvironmentOptions

        public final Object getTestEnvironmentOptions()
        Description copied from interface: JestConfigOptions
        (experimental) Test environment options that will be passed to the testEnvironment.

        The relevant options depend on the environment.

        Default: - {}

        Specified by:
        getTestEnvironmentOptions in interface JestConfigOptions
      • getTestMatch

        public final List<String> getTestMatch()
        Description copied from interface: JestConfigOptions
        (experimental) The glob patterns Jest uses to detect test files.

        By default it looks for .js, .jsx, .ts and .tsx files inside of tests folders, as well as any files with a suffix of .test or .spec (e.g. Component.test.js or Component.spec.js). It will also find files called test.js or spec.js.

        Default: ['**\/__tests__/**\/*.[jt]s?(x)', '**\/?(*.)+(spec|test).[tj]s?(x)']

        Specified by:
        getTestMatch in interface JestConfigOptions
      • getTestPathIgnorePatterns

        public final List<String> getTestPathIgnorePatterns()
        Description copied from interface: JestConfigOptions
        (experimental) An array of regexp pattern strings that are matched against all test paths before executing the test.

        If the test path matches any of the patterns, it will be skipped.

        Default: - ["/node_modules/"]

        Specified by:
        getTestPathIgnorePatterns in interface JestConfigOptions
      • getTestRegex

        public final Object getTestRegex()
        Description copied from interface: JestConfigOptions
        (experimental) The pattern or patterns Jest uses to detect test files.

        By default it looks for .js, .jsx, .ts and .tsx files inside of tests folders, as well as any files with a suffix of .test or .spec (e.g. Component.test.js or Component.spec.js). It will also find files called test.js or spec.js.

        Default: - (/__tests__/.*|(\\.|/)(test|spec))\\.[jt]sx?$

        Specified by:
        getTestRegex in interface JestConfigOptions
      • getTestRunner

        public final String getTestRunner()
        Description copied from interface: JestConfigOptions
        (experimental) This option allows the use of a custom test runner.

        The default is jasmine2. A custom test runner can be provided by specifying a path to a test runner implementation.

        Default: - "jasmine2"

        Specified by:
        getTestRunner in interface JestConfigOptions
      • getTestSequencer

        public final String getTestSequencer()
        Description copied from interface: JestConfigOptions
        (experimental) This option allows you to use a custom sequencer instead of Jest's default.

        Sort may optionally return a Promise.

        Default: - "@jest/test-sequencer"

        Specified by:
        getTestSequencer in interface JestConfigOptions
      • getTestURL

        public final String getTestURL()
        Description copied from interface: JestConfigOptions
        (experimental) This option sets the URL for the jsdom environment.

        It is reflected in properties such as location.href.

        Default: - "http://localhost"

        Specified by:
        getTestURL in interface JestConfigOptions
      • getTimers

        public final String getTimers()
        Description copied from interface: JestConfigOptions
        (experimental) Setting this value to legacy or fake allows the use of fake timers for functions such as setTimeout.

        Fake timers are useful when a piece of code sets a long timeout that we don't want to wait for in a test.

        Default: - "real"

        Specified by:
        getTimers in interface JestConfigOptions
      • getTransform

        public final Map<String,​Transform> getTransform()
        Description copied from interface: JestConfigOptions
        (experimental) A map from regular expressions to paths to transformers.

        A transformer is a module that provides a synchronous function for transforming source files.

        Default: - {"\\.[jt]sx?$": "babel-jest"}

        Specified by:
        getTransform in interface JestConfigOptions
      • getTransformIgnorePatterns

        public final List<String> getTransformIgnorePatterns()
        Description copied from interface: JestConfigOptions
        (experimental) An array of regexp pattern strings that are matched against all source file paths before transformation.

        If the test path matches any of the patterns, it will not be transformed.

        Default: - ["/node_modules/", "\\.pnp\\.[^\\\/]+$"]

        Specified by:
        getTransformIgnorePatterns in interface JestConfigOptions
      • getUnmockedModulePathPatterns

        public final List<String> getUnmockedModulePathPatterns()
        Description copied from interface: JestConfigOptions
        (experimental) An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them.

        If a module's path matches any of the patterns in this list, it will not be automatically mocked by the module loader.

        Default: - []

        Specified by:
        getUnmockedModulePathPatterns in interface JestConfigOptions
      • getVerbose

        public final Boolean getVerbose()
        Description copied from interface: JestConfigOptions
        (experimental) Indicates whether each individual test should be reported during the run.

        All errors will also still be shown on the bottom after execution. Note that if there is only one test file being run it will default to true.

        Default: - false

        Specified by:
        getVerbose in interface JestConfigOptions
      • getWatchPathIgnorePatterns

        public final List<String> getWatchPathIgnorePatterns()
        Description copied from interface: JestConfigOptions
        (experimental) An array of RegExp patterns that are matched against all source file paths before re-running tests in watch mode.

        If the file path matches any of the patterns, when it is updated, it will not trigger a re-run of tests.

        Default: - []

        Specified by:
        getWatchPathIgnorePatterns in interface JestConfigOptions
      • $jsii$toJson

        @Internal
        public com.fasterxml.jackson.databind.JsonNode $jsii$toJson()
        Specified by:
        $jsii$toJson in interface software.amazon.jsii.JsiiSerializable
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class Object