Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 29, 2024 via pnpm

jest-validate 29.7.0

Generic configuration validation tool that helps you with warnings, errors and deprecation messages as well as showing users examples of correct configuration.
Package summary
Share
0
issues
1
license
23
MIT
Package created
8 Jan 2017
Version published
12 Sep 2023
Maintainers
6
Total deps
23
Direct deps
6
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
23 Packages, Including:
@jest/schemas@29.6.3
@jest/types@29.6.3
@sinclair/typebox@0.27.8
@types/istanbul-lib-coverage@2.0.6
@types/istanbul-lib-report@3.0.3
@types/istanbul-reports@3.0.4
@types/node@20.12.13
@types/yargs-parser@21.0.3
@types/yargs@17.0.32
ansi-styles@4.3.0
ansi-styles@5.2.0
camelcase@6.3.0
chalk@4.1.2
color-convert@2.0.1
color-name@1.1.4
has-flag@4.0.0
jest-get-type@29.6.3
jest-validate@29.7.0
leven@3.1.0
pretty-format@29.7.0
react-is@18.3.1
supports-color@7.2.0
undici-types@5.26.5
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

6
All Dependencies CSV
β“˜ This is a list of jest-validate 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
@jest/types29.6.38 kBMIT
prod
camelcase6.3.03.75 kBMIT
prod
chalk4.1.211.31 kBMIT
prod
jest-get-type29.6.31.72 kBMIT
prod
leven3.1.02.44 kBMIT
prod
pretty-format29.7.014.34 kBMIT
prod

Visualizations

Frequently Asked Questions

What does jest-validate do?

Jest-validate serves as a generic configuration validation tool. It assists in providing warnings, errors, and deprecation messages, and it points users to examples of correctly-configured code. This can be extremely helpful for developers as it guides them in locating and remedying potential issues in their code.

How do you use jest-validate?

The jest-validate npm package comes with installation instructions. Using the terminal, one can install the package with the following command: npm install --save jest-validate. After successful installation, jest-validate can be imported into a JavaScript file.

A basic example usage is:

import {validate} from 'jest-validate';
validate(config, validationOptions); // => {hasDeprecationWarnings: boolean, isValid: boolean}

Here, config would be your configuration object, and validationOptions are options for validation with "exampleConfig" as the only required option. These validation options come with a variety of parameters, including "comment", for customizing error/warning message details; "condition" for defining a special validation condition; "deprecatedConfig" for specifying deprecated keys; among others. Examples of their usage can be found in the provided repository link.

validate(config, {
  comment: '  Documentation: http://custom-docs.com',
  deprecatedConfig,
  exampleConfig,
  title: {
    deprecation: 'Custom Deprecation',
  },
});

You can also validate configurations where multiple types are permissible:

import {multipleValidOptions} from 'jest-validate';

validate(config, {
  // `bar` will accept either a string or a number
  bar: multipleValidOptions('string is ok', 2),
});

Furthermore, jest-validate can be used to validate CLI arguments:

import {validate} from 'jest-validate';

validateCLIOptions(argv, {...allowedOptions, deprecatedOptions});

Where are the jest-validate docs?

The full documentation for jest-validate, including more examples and further information about its configuration, is directly accessible on its GitHub page: git+https://github.com/jestjs/jest.git. Developers are encouraged to reference and leverage these extensive docs to better understand the structures and possibilities jest-validate offers.