1.0.1 • Published 5 years ago

string-snapshot-serializer v1.0.1

Weekly downloads
54
License
MIT
Repository
github
Last release
5 years ago

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