Skip to content

[Bug]: Cannot show diff when .toMatchInlineSnapshot throws exception #13180

@liuxingbaoyu

Description

@liuxingbaoyu

Version

29.0

Steps to reproduce

git clone https://github.com/babel/babel
yarn up jest*
make build
yarn jest babel-preset-react

I know this is overly complicated to reproduce, I'm still investigating, just opened an issue first in case anyone can think of what could be the reason for this, will update if I find anything new!😃

Expected behavior

Differences are displayed normally.

Actual behavior

normalize options › Babel 7 › default values

    expect(received).toMatchInlineSnapshot(snapshot)

    Snapshot name: `normalize options Babel 7 default values 2`

    - Snapshot  - 0
    + Received  + 0

    @@ -7,5 +7,5 @@
        "runtime": "automatic",
        "throwIfNamespace": true,
        "useBuiltIns": undefined,
        "useSpread": undefined,
      }

      113 |         }
      114 |       `);
    > 115 |       expect(normalizeOptions({ runtime: "automatic" })).toMatchInlineSnapshot(`
          |                                                          ^
      116 |         Object {
      117 |           "development": false,
      118 |           "importSource": undefined,

      at Object.toMatchInlineSnapshot (packages/babel-preset-react/test/normalize-options.skip-bundled.js:115:58)

Additional context

No response

Environment

System:
    OS: Windows 10 10.0.22000
    CPU: (16) x64 11th Gen Intel(R) Core(TM) i7-11700KF @ 3.60GHz
  Binaries:
    Node: 18.7.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 3.1.1 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 8.15.0 - C:\Program Files\nodejs\npm.CMD
  npmPackages:
    jest: ^29.0.0 => 29.0.0

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