Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jest-snapshot-serializer-raw

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-snapshot-serializer-raw

jest snapshot serializer for reducing escapes in the snapshot file

  • 1.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
25K
increased by52.48%
Maintainers
1
Weekly downloads
 
Created
Source

jest-snapshot-serializer-raw

npm build coverage

jest snapshot serializer for reducing escapes in the snapshot file

(This package is modified from prettier/prettier:tests_config/raw-serializer.js@9ec1da1a)

Changelog

Install

# using npm
npm install --save-dev jest-snapshot-serializer-raw

# using yarn
yarn add --dev jest-snapshot-serializer-raw

Usage

{
  "snapshotSerializers": ["jest-snapshot-serializer-raw"]
}
// test.js

const { wrap } = require('jest-snapshot-serializer-raw');
const example = `paragraph "one"\n\n'paragraph' \\two\\`;

test('before', () => {
  expect(example).toMatchSnapshot();
});

test('after', () => {
  expect(wrap(example)).toMatchSnapshot();
});
// test.js.snap

exports[`before 1`] = `
"paragraph \\"one\\"

'paragraph' \\\\two\\\\"
`;

exports[`after 1`] = `
paragraph "one"

'paragraph' \\two\\
`;

Development

# lint
yarn run lint

# build
yarn run build

# test
yarn run test

License

MIT © Ika

Keywords

FAQs

Package last updated on 10 Jul 2018

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc