
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
jest-serializer-date
Advanced tools
Jest snapshot serializer to remove annoying Date object inconsistencies
When encountering a JavaScript Date object within a Jest snapshot, this serializer determines if the date corresponds to the current date (new Date()
) or not. It then serializes them as follows:
Current Date:
- "yourDate": 2018-07-13T22:42:46.531Z
+ "yourDate": "Current Date"
Non-current Date:
- "yourDate": 2018-07-13T22:42:46.531Z
+ "yourDate": "07-13-2018"
This effectively avoids errors where snapshots fail because
new Date()
was used, and the snapshot test was re-run on a different dateInstall the package as a dev-dependency:
# npm
npm install --save-dev jest-serializer-date
# yarn
yarn add --dev jest-serializer-date
Tell jest to use the package in package.json:
"jest": {
"snapshotSerializers": ["jest-serializer-date"]
}
FAQs
Jest snapshot serializer to remove annoying Date object inconsistencies
We found that jest-serializer-date 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.