Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
jest-environment-enzyme
Advanced tools
Readme
Setting up Enzyme with Jest and React is a somewhat complicated process. There are a lot of dependencies, configuring adapters, etc. This module will take lessen that setup and make it more declarative. This package will also simplify your test files by declaring React, and enzyme wrappers in the global scope. This means that all of your test files don't need to include imports for React or enzyme.
The setup can be as simple as this:
yarn add jest-environment-enzyme jest-enzyme enzyme-adapter-react-* --dev
(Where * is your app's adapter that matches your React version)
For example, if you are using react-16, it should look like:
yarn add jest-environment-enzyme jest-enzyme enzyme-adapter-react-16 --dev
// package.json
"jest": {
"setupFilesAfterEnv": ["jest-enzyme"],
"testEnvironment": "enzyme"
}
Additionally, you can specify which enzyme adapter you want to use through the testEnvironmentOptions.enzymeAdapter
.
Valid options are:
react13
react14
react15
react15.4
react16
(default)// package.json
"jest": {
"setupFilesAfterEnv": ["jest-enzyme"],
"testEnvironment": "enzyme",
"testEnvironmentOptions": {
"enzymeAdapter": "react16"
}
}
Lastly, and most importantly, this library has a hard requirement on jest-enzyme
.
FAQs
Runtime Environment for enzyme tests in jest
The npm package jest-environment-enzyme receives a total of 344,312 weekly downloads. As such, jest-environment-enzyme popularity was classified as popular.
We found that jest-environment-enzyme demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.