Skip to content
This repository was archived by the owner on Sep 21, 2019. It is now read-only.

Use Jest snapshots #24

Closed
wants to merge 1 commit into from
Closed

Use Jest snapshots #24

wants to merge 1 commit into from

Conversation

mohsen1
Copy link
Contributor

@mohsen1 mohsen1 commented Jan 20, 2018

Not sure if this is better than manually writing output.tsx files. This has the benefit of auto-updating snapshots but its harder to read

@vincentbel What you think?

@vincentbel
Copy link
Contributor

@mohsen1 I think the original one are better:

  • It's easier to read
  • It is an ts file, I can get syntax highlighting, compile info, lint info in my editor
  • I think people are take less care about snapshot file

In the previous PRs, the way I update outputx.tsx is I first check if the transform result are ok. If it is ok, I then overwrite the result to output.tsx by adding the following line to runner.ts.

fs.writeFileSync('output.tsx', result)

I think it's not that trouble. I can even recheck the result in git.

@mohsen1
Copy link
Contributor Author

mohsen1 commented Jan 21, 2018

hehe, I did exactly that for the prettier PR. Maybe we can look for -u (--updateSnapshot) switch and write to results.

@mohsen1 mohsen1 closed this Jan 21, 2018
@mohsen1 mohsen1 deleted the snapshot branch January 21, 2018 01:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants