Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
jest-serializer-path
Advanced tools
Remove absolute paths and normalize paths across all platforms in your Jest snapshots.
NOTE: All single backslashes ("\") will be replaced by a forward slash ("/"). Also, any string that looks like a Windows drive letter ("C:\") will be replaced by a forward slash ("/").
npm install --save-dev jest-serializer-path
Add this to your package.json
Jest config:
"jest": {
"snapshotSerializers": [
"jest-serializer-path"
]
}
Or include only in individual tests:
const serializer = require('jest-serializer-path')
expect.addSnapshotSerializer(serializer)
All absolute paths will now be converted and saved in snapshots like so:
/path/to/my-proj/lib
=> <PROJECT_ROOT>/lib
This project bundles the yarn executable and the npm/yarn dependencies offline
in the .npm-packages-offline-cache
directory for faster dependency installs
and better dev/prod parity across including preventing failure if yarn/npm is
offline.
# Install
npm run yarn
# Run tests
npm run test
FAQs
Remove absolute paths from your Jest snapshots
We found that jest-serializer-path 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.