Update jest completion and shorten too long description

This commit is contained in:
Shohei YOSHIDA 2026-02-18 12:01:25 +09:00
parent ea15ee250e
commit fbddce1074
No known key found for this signature in database
GPG Key ID: C9A1BB11BB940CF2
1 changed files with 106 additions and 104 deletions

210
src/_jest
View File

@ -28,7 +28,7 @@
# Description # Description
# ----------- # -----------
# #
# Completion script for Jest 29.7.0 (https://jestjs.io/) # Completion script for Jest 30.1.3 (https://jestjs.io/)
# #
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# Authors # Authors
@ -41,112 +41,114 @@
local curcontext=$curcontext state line ret=1 local curcontext=$curcontext state line ret=1
declare -A opt_args declare -A opt_args
local -a notify_modes=("always" "failure" "success" "change" "success-change" "failure-change")
_arguments -C -s \ _arguments -C -s \
'(- : *)'{-h,--help}'[Show help]' \ '(- : *)'{-h,--help}'[Show help]' \
'(- : *)'--version'[Show version number]' \ '(- : *)'--version'[Show version number]' \
--all'[The opposite of `onlyChanged`.]' \ '--all[The opposite of "onlyChanged"]' \
--automock'[Automock all files by default.]' \ '--automock[Automock all files by default]' \
'(-b --bail)'{-b,--bail}'[Exit the test suite immediately after `n` number of failing tests.]' \ '(-b --bail)'{-b,--bail}'[Exit the test suite immediately after "n" number of failing tests]' \
--cache'[Whether to use the transform cache.]' \ '(--cache --no-cache)--cache[Use the transform cache]' \
--cacheDirectory'[The directory where Jest should store its cached dependency information.]:directories:_dirs' \ '(--cache --no-cache)--no-cache[Do not use the transform cache]' \
--changedFilesWithAncestor'[Runs tests related to the current changes and the changes made in the last commit.]' \ '--cacheDirectory[The directory where Jest should store its cached dependency information]:dir:_files -/' \
--changedSince'[Runs tests related to the changes since the provided branch.]:string' \ '--changedFilesWithAncestor[Run tests related to the current changes and the changes made in the last commit]' \
--ci'[Whether to run Jest in continuous integration (CI) mode.]' \ '--changedSince[Run tests related to the changes since the provided branch]:string' \
--clearCache'[Clears the configured Jest cache directory and then exits.]' \ '--ci[Run Jest in continuous integration (CI) mode]' \
--clearMocks'[Automatically clear mock calls, instances, contexts and results before every test.]' \ '--clearCache[Clear the configured Jest cache directory and then exits]' \
--collectCoverageFrom'[A glob pattern relative to <rootDir> matching the files that coverage info needs to be collected from.]:string' \ '--clearMocks[Automatically clear mock calls, instances, contexts and results before every test]' \
'(--color --colors)'{--color,--colors}'[Forces test results output color highlighting (even if stdout is not a TTY).]' \ '--collectCoverageFrom[A glob pattern for collecting coverage info]:string' \
'(-c --config)'{-c,--config}'[The path to a jest config file specifying how to find and execute tests.]:files:_files' \ '(--color --colors)'{--color,--colors}'[Force test results output color highlighting (even if stdout is not a TTY)]' \
'(--coverage --collectCoverage)'{--coverage,--collectCoverage}'[Indicates that test coverage information should be collected and reported in the output.]' \ '(-c --config)'{-c,--config}'[The path to a jest config file specifying how to find and execute tests]:files:_files' \
--coverageDirectory'[The directory where Jest should output its coverage files.]:directories:_dirs' \ '(--coverage --collectCoverage)'{--coverage,--collectCoverage}'[Indicate that test coverage information should be collected and reported in the output]' \
--coveragePathIgnorePatterns'[An array of regexp pattern strings that are matched against all file paths before executing the test.]:array:' \ '--coverageDirectory[The directory where Jest should output its coverage files]:dir:_files -/' \
--coverageProvider'[Select between Babel and V8 to collect coverage]:choices:(babel v8)' \ '--coveragePathIgnorePatterns[An array of regexp pattern strings that are matched against all file paths before executing the test]:array' \
--coverageReporters'[A list of reporter names that Jest uses when writing coverage reports.]:array' \ '--coverageProvider[Select between Babel and V8 to collect coverage]:choices:(babel v8)' \
--coverageThreshold'[A JSON string with which will be used to configure minimum threshold enforcement for coverage results]:string' \ '--coverageReporters[A list of reporter names that Jest uses when writing coverage reports]:array' \
--debug'[Print debugging info about your jest config.]' \ '--coverageThreshold[A JSON string with which will be used to configure minimum threshold enforcement for coverage results]:string' \
--detectLeaks'[**EXPERIMENTAL**: Detect memory leaks in tests.]' \ '--debug[Print debugging info about your jest config]' \
--detectOpenHandles'[Print out remaining open handles preventing Jest from exiting at the end of a test run.]' \ '--detectLeaks[**EXPERIMENTAL**: Detect memory leaks in tests]' \
'(--env --testEnvironment)'{--env,--testEnvironment}'[The test environment used for all tests.]:files:_files' \ '--detectOpenHandles[Print out remaining open handles preventing Jest from exiting at the end of a test run]' \
--errorOnDeprecated'[Make calling deprecated APIs throw helpful error messages.]' \ '(--env --testEnvironment)'{--env,--testEnvironment}'[The test environment used for all tests]:files:_files' \
'(-e --expand)'{-e,--expand}'[Use this flag to show full diffs instead of a patch.]' \ '--errorOnDeprecated[Make calling deprecated APIs throw helpful error messages]' \
--filter'[Path to a module exporting a filtering function.]:string' \ '(-e --expand)'{-e,--expand}'[Use this flag to show full diffs instead of a patch]' \
--findRelatedTests'[Find related tests for a list of source files that were passed in as arguments.]' \ '--filter[Path to a module exporting a filtering function]:string' \
--forceExit'[Force Jest to exit after all tests have completed running.]' \ '--findRelatedTests[Find related tests for a list of source files that were passed in as arguments]' \
--globalSetup'[The path to a module that runs before All Tests.]:files:_files' \ '--forceExit[Force Jest to exit after all tests have completed running]' \
--globalTeardown'[The path to a module that runs after All Tests.]:files:_files' \ '--globalSetup[The path to a module that runs before All Tests]:files:_files' \
--globals'[A JSON string with map of global variables that need to be available in all test environments.]:string' \ '--globalTeardown[The path to a module that runs after All Tests]:files:_files' \
--haste'[A JSON string with map of variables for the haste module system]:string' \ '--globals[A JSON string with map of global variables that need to be available in all test environments]:string' \
--ignoreProjects'[Ignore the tests of the specified projects.]:array' \ '--haste[A JSON string with map of variables for the haste module system]:string' \
--init'[Generate a basic configuration file]' \ '--ignoreProjects[Ignore the tests of the specified projects]:array' \
--injectGlobals'[Should Jest inject global variables or not]' \ '--injectGlobals[Should Jest inject global variables or not]' \
--json'[Prints the test results in JSON.]' \ '--json[Print the test results in JSON]' \
--lastCommit'[Run all tests affected by file changes in the last commit made.]' \ '--lastCommit[Run all tests affected by file changes in the last commit made]' \
--listTests'[Lists all tests Jest will run given the arguments and exits.]' \ '--listTests[List all tests Jest will run given the arguments and exits]' \
--logHeapUsage'[Logs the heap usage after every test.]' \ '--logHeapUsage[Log the heap usage after every test]' \
--maxConcurrency'[Specifies the maximum number of tests that are allowed to run concurrently.]:number' \ '--maxConcurrency[Specify the maximum number of tests that are allowed to run concurrently]:number' \
'(-w --maxWorkers)'{-w,--maxWorkers}'[Specifies the maximum number of workers the worker-pool will spawn for running tests.]:string' \ '(-w --maxWorkers)'{-w,--maxWorkers}'[Maximum number of workers will spawn for running tests]:string' \
--moduleDirectories'[An array of directory names to be searched recursively up from the requiring module'"'"'s location.]:directories:_dirs' \ "--moduleDirectories[Directories to be searched from the requiring module's location]:dir:_files -/" \
--moduleFileExtensions'[An array of file extensions your modules use.]:array' \ '--moduleFileExtensions[An array of file extensions your modules use]:array' \
--moduleNameMapper'[A JSON string with a map from regular expressions to module names or to arrays of module names that allow to stub out resources]:string' \ '--moduleNameMapper[A JSON string with a map from regular expressions to module names]:string' \
--modulePathIgnorePatterns'[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.]:array' \ '--modulePathIgnorePatterns[An array of ignore module pattern]:array' \
--modulePaths'[An array of absolute paths to additional locations to search when resolving modules.]:directories:_dirs' \ '--modulePaths[An array of absolute paths to search modules]:directories:_files -/' \
--no-cache'[Do not use the transform cache.]' \ '--noStackTrace[Disable stack trace in test results output]' \
--no-watchman'[Disable watchman for file crawling.]' \ '--notify[Activate notifications for test results]' \
--noStackTrace'[Disables stack trace in test results output]' \ '--notifyMode[Specify notification mode for test results]:mode:($notify_modes)' \
--notify'[Activates notifications for test results.]' \ '(-o --onlyChanged)'{-o,--onlyChanged}'[Attempt to identify which tests to run based on which files have changed in the current repository]' \
--notifyMode'[Specifies when notifications will appear for test results.]:string' \ '(-f --onlyFailures)'{-f,--onlyFailures}'[Run tests that failed in the previous execution]' \
'(-o --onlyChanged)'{-o,--onlyChanged}'[Attempts to identify which tests to run based on which files have changed in the current repository.]' \ '--openHandlesTimeout[Timeout msecs for open handle warnings]:number' \
'(-f --onlyFailures)'{-f,--onlyFailures}'[Run tests that failed in the previous execution.]' \ '--outputFile[Output file name of test results]:files:_files' \
--openHandlesTimeout'[Print a warning about probable open handles if Jest does not exit cleanly after this number of milliseconds.]:number' \ '--passWithNoTests[Will not fail if no tests are found]' \
--outputFile'[Write test results to a file when the --json option is also specified.]:files:_files' \ "--preset[A preset that is used as a base for Jest's configuration]:string" \
--passWithNoTests'[Will not fail if no tests are found (for example while using `--testPathPattern`.)]' \ '--prettierPath[The path to the "prettier" module used for inline snapshots]:string' \
--preset'[A preset that is used as a base for Jest'"'"'s configuration.]:string' \ '--projects[Projects that use Jest to run all tests of all projects in a single instance]:array' \
--prettierPath'[The path to the "prettier" module used for inline snapshots.]:string' \ '--randomize[Shuffle the order of the tests within a file]' \
--projects'[A list of projects that use Jest to run all tests of all projects in a single instance of Jest.]:array' \ '--reporters[A list of custom reporters for the test suite]:array' \
--randomize'[Shuffle the order of the tests within a file.]' \ '--resetMocks[Automatically reset mock state before every test]' \
--reporters'[A list of custom reporters for the test suite.]:array' \ '--resetModules[The module registry for every test file will be reset before running each test]' \
--resetMocks'[Automatically reset mock state before every test.]' \ '--resolver[A JSON string which allows the use of a custom resolver]:string' \
--resetModules'[If enabled, the module registry for every test file will be reset before running each individual test.]' \ '--restoreMocks[Automatically restore mock state and implementation before every test]' \
--resolver'[A JSON string which allows the use of a custom resolver.]:string' \ '--rootDir[The root directory that Jest should scan for tests and modules]:dir:_files -/' \
--restoreMocks'[Automatically restore mock state and implementation before every test.]' \ '--roots[A list directories that Jest should use to search for files in]:array:_files -/' \
--rootDir'[The root directory that Jest should scan for tests and modules within.]:directories:_dirs' \ '(-i --runInBand)'{-i,--runInBand}'[Run all tests serially in the current process]' \
--roots'[A list of paths to directories that Jest should use to search for files in.]:array' \ '--runTestsByPath[Used when provided patterns are exact file paths]' \
'(-i --runInBand)'{-i,--runInBand}'[Run all tests serially in the current process.]' \ "--runner[Use a custom runner instead of Jest's default test runner]:string" \
--runTestsByPath'[Used when provided patterns are exact file paths.]' \ '--seed[Set a seed value that can be retrieved in a tests file via "jest.getSeed()"]:number' \
--runner'[Allows to use a custom runner instead of Jest'"'"'s default test runner.]:string' \ '--selectProjects[Run the tests of the specified projects]:array' \
--seed'[Sets a seed value that can be retrieved in a tests file via `jest.getSeed()`.]:number' \ '--setupFiles[Module paths that configure or set up the testing environment before each test]:files:_files' \
--selectProjects'[Run the tests of the specified projects.]:array' \ '--setupFilesAfterEnv[Module paths that configure or set up the testing framework before each test]:files:_files' \
--setupFiles'[A list of paths to modules that run some code to configure or set up the testing environment before each test.]:files:_files' \ '--shard[Shard tests and execute only the selected shard]:shard' \
--setupFilesAfterEnv'[A list of paths to modules that run some code to configure or set up the testing framework before each test]:files:_files' \ '--showConfig[Print your jest config and then exits]' \
--shard'[Shard tests and execute only the selected shard]:files:_files' \ '--showSeed[Print the seed value in the test report summary]' \
--showConfig'[Print your jest config and then exits.]' \ '--silent[Prevent tests from printing messages through the console]' \
--showSeed'[Prints the seed value in the test report summary.]' \ '--skipFilter[Disable the filter provided by --filter]' \
--silent'[Prevent tests from printing messages through the console.]' \ '--snapshotSerializers[Paths of snapshot serializer modules for snapshot testing]:files:_files' \
--skipFilter'[Disables the filter provided by --filter.]' \ '--testEnvironmentOptions[Options that will be passed to the "testEnvironment"]:string' \
--snapshotSerializers'[A list of paths to snapshot serializer modules Jest should use for snapshot testing.]:files:_files' \ '--testFailureExitCode[Exit code of "jest" command if the test run failed]:string' \
--testEnvironmentOptions'[A JSON string with options that will be passed to the `testEnvironment`.]:string' \ '--testLocationInResults[Add "location" information to the test results]' \
--testFailureExitCode'[Exit code of `jest` command if the test run failed]:string' \ '--testMatch[The glob patterns Jest uses to detect test files]:array' \
--testLocationInResults'[Add `location` information to the test results]' \ '(-t --testNamePattern)'{-t,--testNamePattern}'[Run only tests with a name that matches the regex pattern]:string' \
--testMatch'[The glob patterns Jest uses to detect test files.]:array' \ '--testPathIgnorePatterns[Regexp patterns for ignoring tests]:array' \
'(-t --testNamePattern)'{-t,--testNamePattern}'[Run only tests with a name that matches the regex pattern.]:string' \ '--testPathPatterns[Regexp patterns for executing tests]:array' \
--testPathIgnorePatterns'[An array of regexp pattern strings that are matched against all test paths before executing the test.]:array' \ '--testRegex[Regexp patterns that Jest uses to detect test files]:array' \
--testPathPattern'[A regexp pattern string that is matched against all tests paths before executing the test.]:array' \ '--testResultsProcessor[Specify a custom results processor]:string' \
--testRegex'[A string or array of string regexp patterns that Jest uses to detect test files.]:array' \ '--testRunner[Specify a custom test runner]:string' \
--testResultsProcessor'[Allows the use of a custom results processor.]:string' \ '--testSequencer[Specify a custom test sequencer]:string' \
--testRunner'[Allows to specify a custom test runner.]:string' \ '--testTimeout[Default timeout of test cases]:number' \
--testSequencer'[Allows to specify a custom test sequencer.]:string' \ '--transform[A JSON string which maps from regular expressions to paths to transformers]:string' \
--testTimeout'[This option sets the default timeouts of test cases.]:number' \ '--transformIgnorePatterns[Ignore regexp patterns for transformation]:array' \
--transform'[A JSON string which maps from regular expressions to paths to transformers.]:string' \ '--unmockedModulePathPatterns[Regexp patterns for unmocked modules]:array' \
--transformIgnorePatterns'[An array of regexp pattern strings that are matched against all source file paths before transformation.]:array' \ '(-u --updateSnapshot)'{-u,--updateSnapshot}'[Re-record snapshots]' \
--unmockedModulePathPatterns'[An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them.]:array' \ '--useStderr[Divert all output to stderr]' \
'(-u --updateSnapshot)'{-u,--updateSnapshot}'[Use this flag to re-record snapshots.]' \ '--verbose[Display individual test results with the test suite hierarchy]' \
--useStderr'[Divert all output to stderr.]' \ '--waitForUnhandledRejections[Give one event loop turn to handle unhandles rejections]' \
--verbose'[Display individual test results with the test suite hierarchy.]' \ '--watch[Watch files for changes and rerun tests related to changed files]' \
--watch'[Watch files for changes and rerun tests related to changed files.]' \ '--watchAll[Watch files for changes and rerun all tests]' \
--watchAll'[Watch files for changes and rerun all tests.]' \ '--watchPathIgnorePatterns[Ignore patterns of watch path]:array' \
--watchPathIgnorePatterns'[An array of regexp pattern strings that are matched against all paths before trigger test re-run in watch mode.]:array' \ '(--watchman --no-watchman)--watchman[Use watchman for file crawling]' \
--watchman'[Whether to use watchman for file crawling.]' \ '(--watchman --no-watchman)--no-watchman[Do not use watchman for file crawling]' \
--workerThreads'[Whether to use worker threads for parallelization.]' \ '--workerThreads[Use worker threads for parallelization]' \
'*: :->file' \ '*: :->file' \
&& ret=0 && ret=0