string-snapshot-serializer
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

string-snapshot-serializer

Build Status tested with jest styled with prettier All Contributors

serializer for string escape

Install

$ npm install string-snapshot-serializer

Usage

import { getSnapshotSerializer } from 'string-snapshot-serializer'

expect.addSnapshotSerializer(getSnapshotSerializer())
before:
exports[`snapshot`] = `"test \\"unicorn\\""`;

after:
exports[`snapshot`] = `test "unicorn"`;

...or add it globally to your jest config:

// jest.config.js
module.exports = {
  snapshotSerializers: [
    require.resolve('string-snapshot-serializer/serializer.js'),
  ],
}

Contributors

Thanks goes to these wonderful people (emoji key):


akameco

💻 📖 ⚠️ 🚇

This project follows the all-contributors specification. Contributions of any kind welcome!

License

MIT © akameco

Package Sidebar

Install

npm i string-snapshot-serializer

Weekly Downloads

28

Version

1.0.1

License

MIT

Unpacked Size

5.5 kB

Total Files

9

Last publish

Collaborators

  • akameco