Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
jest-config
Advanced tools
The jest-config package is used for configuring Jest, a popular JavaScript testing framework. It allows developers to programmatically access and manipulate Jest's configuration settings, making it easier to set up and customize tests for JavaScript projects. This package is particularly useful for complex setups or when integrating Jest into larger, automated workflows.
Accessing Default Configuration
This feature allows developers to access Jest's default configuration settings. It's useful for understanding the baseline configuration and for extending or customizing these defaults in a project.
const { defaults } = require('jest-config');
console.log(defaults);
Generating a Custom Configuration
This feature enables the creation of a custom Jest configuration programmatically. It's particularly useful for dynamically generating configurations based on specific project requirements or environments.
const { makeConfig } = require('jest-config');
const customConfig = makeConfig({
rootDir: process.cwd(),
transform: {
'^.+\\.js$': 'babel-jest'
}
});
console.log(customConfig);
Mocha is a feature-rich JavaScript test framework running on Node.js and in the browser, making asynchronous testing simple. While Mocha itself is not a configuration tool, it offers a flexible API and a variety of command-line options for configuring tests, similar to how jest-config allows for Jest test configuration.
Karma is a test runner for JavaScript that runs on Node.js. It is designed to work with any testing framework, such as Jasmine, Mocha, or QUnit. Karma itself is more about running tests in different environments rather than configuring a specific testing framework. However, it deals with the aspect of setting up testing environments, which can be seen as a parallel to configuring testing frameworks with jest-config.
AVA is a test runner for Node.js with a concise API, detailed error output, and process isolation that lets you develop with confidence. AVA's configuration approach is more direct and less flexible compared to jest-config, focusing on simplicity and convention over configuration.
jest 18.0.0
See https://jestjs.io/blog/2016/12/15/2016-in-jest
pit
and mockImpl
. Use it
or mockImplementation
instead.--bail
is used together with --watch
.pretty-format
is now merged into Jest.require('v8')
now works properly in a test context.expect.any
, expect.anything
, expect.objectContaining
, expect.arrayContaining
, expect.stringMatching
.snapshotSerializers
, setupFiles
, transform
, testRunner
and testResultsProcessor
instead of using path.resolve
.--testResultsProcessor
is now exposed through the cli.--jsonOutputFile
to --outputFile
.jest-editor-support
for vscode and Nuclide integration.test.concurrent
unhandled promise rejections.testRegex
to include test.js
and spec.js
files.babel-plugin-jest-hoist
when using jest.mock
with three arguments.JSON
global in jest-environment-node
now comes from the vm context instead of the parent context.FakeTimers.useTimers()
is called.JEST_HIDE_USAGE
.expect.assertions(number)
which will ensure that a specified amount of assertions is made in one test..toMatchSnapshot(?string)
feature to give snapshots a name.jest-react-native
was deprecated and now forwards react-native
..toMatchObject
matcher.NaN% Failed
in the OS notification when using --notify
..toHaveProperty
matcher.Map
/Set
comparisons.test.concurrent
now works with --testNamePattern
.FAQs
Unknown package
The npm package jest-config receives a total of 11,181,607 weekly downloads. As such, jest-config popularity was classified as popular.
We found that jest-config demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.