
Security News
AI Slop Is Polluting Bug Bounty Platforms with Fake Vulnerability Reports
AI-generated slop reports are making bug bounty triage harder, wasting maintainer time, and straining trust in vulnerability disclosure programs.
jest-offline
Advanced tools
Jest-Offline is an addon to your Jest test suite which will fail tests that make network requests.
To install:
yarn add jest-offline
To use:
{
"jest": {
"setupFiles": [
"<rootDir>/node_modules/jest-offline"
]
}
}
Any tests that make network requests will fail with a thrown exception.
Fundamentally, unit tests should not make network requests. Unit tests should be as small as possible and test components in isolation whenever possible.
Any tests that rely on the network are inherently flaky and can put a strain on systems.
The best unit tests are tests that give the exact same result every single time you run the test. If they rely on network then that is simply impossible to achieve.
So jest-offline offers a simple way to:
You could either use this locally in order to see what tests are hitting the network. Or you could enable this by default on CI so no new tests can be added that hit the network.
FAQs
Add to setupFiles in jest to block network access for tests
The npm package jest-offline receives a total of 13,928 weekly downloads. As such, jest-offline popularity was classified as popular.
We found that jest-offline 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
AI-generated slop reports are making bug bounty triage harder, wasting maintainer time, and straining trust in vulnerability disclosure programs.
Research
Security News
The Socket Research team investigates a malicious Python package disguised as a Discord error logger that executes remote commands and exfiltrates data via a covert C2 channel.
Research
Socket uncovered npm malware campaign mimicking popular Node.js libraries and packages from other ecosystems; packages steal data and execute remote code.