Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configure replacement of \ #33

Open
hipstersmoothie opened this issue Jun 22, 2018 · 4 comments
Open

configure replacement of \ #33

hipstersmoothie opened this issue Jun 22, 2018 · 4 comments

Comments

@hipstersmoothie
Copy link

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

@tribou
Copy link
Owner

tribou commented Jun 28, 2018

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.

@hipstersmoothie
Copy link
Author

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/"

@chrisblossom
Copy link
Contributor

chrisblossom commented Jun 28, 2018

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\\');

@Aghassi
Copy link

Aghassi commented May 10, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants