jest-serializer-path
jest-serializer-path copied to clipboard
configure replacement of `\`
I use the \ in some of my snapshots. i never test on windows so i don't need the character to be replaced. would be nice to be able to turn this functionality off somehow
Hi, could you provide an example of how you're using \ in your snapshots? I'm guessing it's being affected by the normalization done with the slash package.
it's an odd use case with special syntax
snapshot before this plugin:
"body": "# First Page /.firstPage\"
snapshot after this plugin:
"body": "# First Page /.firstPage/"
If you want to ensure that \ has not been changed / to in your output, I would recommend writing a test that shows that outside of a snapshot.
const object = {
body: '# First Page /.firstPage\\',
other: true,
};
expect(object).toMatchSnapshot();
expect(object.body).toEqual('# First Page /.firstPage\\');
Just chiming in that this is still an issue and is non trivial to debug. Would be nice to be able to configure it like @hipstersmoothie requested
Specifically, this is a problem if you test regular expressions