Jest Platform
You can cherry pick specific features of Jest and use them as standalone packages. Here's a list of the available packages:
#
jest-changed-filesTool for identifying modified files in a git/hg repository. Exports two functions:
getChangedFilesForRoots
returns a promise that resolves to an object with the changed files and repos.findRepos
returns a promise that resolves to a set of repositories contained in the specified path.
#
ExampleYou can read more about jest-changed-files
in the readme file.
#
jest-diffTool for visualizing changes in data. Exports a function that compares two values of any type and returns a "pretty-printed" string illustrating the difference between the two arguments.
#
Example#
jest-docblockTool for extracting and parsing the comments at the top of a JavaScript file. Exports various functions to manipulate the data inside the comment block.
#
ExampleYou can read more about jest-docblock
in the readme file.
#
jest-get-typeModule that identifies the primitive type of any JavaScript value. Exports a function that returns a string with the type of the value passed as argument.
#
Example#
jest-validateTool for validating configurations submitted by users. Exports a function that takes two arguments: the user's configuration and an object containing an example configuration and other options. The return value is an object with two attributes:
hasDeprecationWarnings
, a boolean indicating whether the submitted configuration has deprecation warnings,isValid
, a boolean indicating whether the configuration is correct or not.
#
ExampleYou can read more about jest-validate
in the readme file.
#
jest-workerModule used for parallelization of tasks. Exports a class Worker
that takes the path of Node.js module and lets you call the module's exported methods as if they were class methods, returning a promise that resolves when the specified method finishes its execution in a forked process.
#
ExampleYou can read more about jest-worker
in the readme file.
#
pretty-formatExports a function that converts any JavaScript value into a human-readable string. Supports all built-in JavaScript types out of the box and allows extension for application-specific types via user-defined plugins.
#
ExampleYou can read more about pretty-format
in the readme file.