string-snapshot-serializer
v1.0.1
Published
serializer for string escape
Downloads
126
Readme
string-snapshot-serializer
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):
This project follows the all-contributors specification. Contributions of any kind welcome!
License
MIT © akameco