Skip to content

Snapshots are different on linux and windows when contain \\ #9614

@alexander-akait

Description

@alexander-akait

🐛 Bug Report

Snapshoting RegExp on windows and linux are difference when it is contains \\.

To Reproduce

describe("regexp", () => {
	it("should work", () => {
		expect({ test: /[\\/]node_modules[\\/]/ }).toMatchInlineSnapshot();
	});
});

Expected behavior

Snapshots should escaped property and equally on windows and linux

Link to repl or repo (highly encouraged)

Original issue: webpack/webpack#10443

envinfo

npx: installed 1 in 2.375s

  System:
    OS: Linux 5.3 Ubuntu 19.10 (Eoan Ermine)
    CPU: (6) x64 AMD FX(tm)-6300 Six-Core Processor
  Binaries:
    Node: 10.15.2 - /usr/bin/node
    Yarn: 1.13.0 - /usr/bin/yarn
    npm: 6.13.7 - /usr/local/bin/npm
  npmPackages:
    jest: ^25.1.0 => 25.1.0 

Additional information: there were no problems using jest@24, looks like it is a regression

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions