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-snapshot-serializer-raw
Advanced tools
jest snapshot serializer for reducing escapes in the snapshot file
jest snapshot serializer for reducing escapes in the snapshot file
(This package is modified from prettier/prettier:tests_config/raw-serializer.js@9ec1da1a
)
npm install jest-snapshot-serializer-raw
Note: This package is now pure ESM, you may want to install jest-snapshot-serializer-raw@1
if you'd like to use it in CJS environment
In setup file or test file:
import serializerRaw from 'jest-snapshot-serializer-raw'
expect.addSnapshotSerializer(serializerRaw)
In test file:
import { wrap } from 'jest-snapshot-serializer-raw'
const example = `paragraph "one"\n\n'paragraph' \\two\\`
test('before', () => {
expect(example).toMatchSnapshot()
})
test('after', () => {
expect(wrap(example)).toMatchSnapshot()
})
In snapshot file:
exports[`before 1`] = `
"paragraph \\"one\\"
'paragraph' \\\\two\\\\"
`
exports[`after 1`] = `
paragraph "one"
'paragraph' \\two\\
`
In setup file or test file:
import serializerRaw from 'jest-snapshot-serializer-raw/always'
expect.addSnapshotSerializer(serializerRaw)
In test file:
const example = `paragraph "one"\n\n'paragraph' \\two\\`
test('after', () => {
expect(example).toMatchSnapshot()
})
In snapshot file:
exports[`after 1`] = `
paragraph "one"
'paragraph' \\two\\
`
# lint
pnpm run lint
# build
pnpm run build
# test
pnpm run test
MIT © Ika
FAQs
jest snapshot serializer for reducing escapes in the snapshot file
We found that jest-snapshot-serializer-raw 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.