Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Package summary
Share
0
issues
0
licenses
Package created
5 Mar 2019
Version published
15 Feb 2023
Maintainers
3
Total deps
0
Direct deps
0
License
MIT
Error Generating Report

Frequently Asked Questions

What does @jest/core do?

@jest/core is a part of Jest - the robust JavaScript testing framework that offers a delightful JavaScript testing experience. It is a package Jest is currently developing to provide a programmatic API. Please be aware, as it is under development, its direct usage is not currently supported. When fully implemented, @jest/core will establish a foundation for effective and comprehensive testing experience in JavaScript.

How do you use @jest/core?

To use @jest/core, you'll need to install Jest and import the package into your current project. Bear in mind that presently its direct usage is unsupported as it's under development. However, once it is fully rolled out, using it might be similar to this:

import { runCLI } from '@jest/core';

const config = {
  passWithNoTests: true,
  roots: '<directory to your tests>'
};

runCLI(config, [process.cwd()])
  .then(result => {
    if (result.results.success) console.log('Tests passed!');
    else console.log('Tests failed!');
  })
  .catch(err => {
    console.error(err);
  });

In the above example, @jest/core is used to programmatically run Jest, runCLI function is imported from the package and is run with specific configuration.

Where are the @jest/core docs?

Currently, the documentation for @jest/core is not separately provided. The package is part of Jest, hence, the primary source for documentation is the Jest's official documentation. Moreover, more details will be provided in the readme file on the package's GitHub repository at git+https://github.com/jestjs/jest.git, once it's fully developed and its usage is supported.