adriantoine/enzyme-to-json

Snapshot's whitespace differs between environments

donpinkus opened this issue · 1 comments

I'm hesitant to open an issue for this - but after a few days of research don't have any other clues.

We are using Jest with Enzyme, and using enzyme-to-json to create snapshots of Enzyme wrappers.

When some of us create snapshots, we get 2 spaces per indentation. When others of us create the snapshots, we get 4 spaces per indentation.

Environment:

  • MacOS
  • Node 9.4.0
  • Jest 22.1.4
  • Enzyme 3.2.0
  • enzyme-to-json 3.0.0

Is there an option in enzyme-to-json that specifies how much whitespace it uses?
Or has anyone experienced whitespace / formatting differences between machines?

Hi @donpinkus,

I'm sorry for the late reply! enzyme-to-json doesn't actually format snapshots, it is transforming Enzyme wrappers in a format compatible with Jest snapshots. As far as I remember the formatting of snapshots was done by the pretty-format package so I think you should open an issue on the Jest repository.

I am closing this as it is not an enzyme-to-json bug.