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

Group inline snapshot transform results by env #118

Merged

Conversation

billyjanitsch
Copy link
Collaborator

Slightly different, less polished approach to #117.

Not sure if this is worth the additional layer of abstraction, but it solves a few problems in that PR:

  • Every test by default has to remember to add an assertion for each env. It would be easy to miss one, especially if the snapshots are too large to all fit on one screen. This approach defaults to transpiling for every env.
  • There's no easy way to tell whether two envs produce the same transpilation result without a close comparison. It's easy to miss subtle differences. This solves that by grouping envs that product the same result. It could also be solved by doing expect(env1Output).toBe(env2Output) but we don't necessarily want to declare as an assertion that these should always be the same, we just want to know if they are and when that changes.

helpers/transform.ts Outdated Show resolved Hide resolved
@billyjanitsch billyjanitsch marked this pull request as ready for review June 8, 2021 17:11
@billyjanitsch billyjanitsch requested a review from a team as a code owner June 8, 2021 17:11
@billyjanitsch billyjanitsch merged commit be57960 into billy/inline-snapshots Jun 8, 2021
@billyjanitsch billyjanitsch deleted the billy/inline-snapshots-env-groups branch June 8, 2021 17:14
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

Successfully merging this pull request may close these issues.

3 participants