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

Chore: Refactor tests to assert snapshots not JSON #311

Merged
merged 2 commits into from
Jun 5, 2017

Conversation

JamesHenry
Copy link
Member

@JamesHenry JamesHenry commented Jun 5, 2017

Naturally, this is a huge diff, but brings with it all of the benefits previously discussed.

  • I have so far only created the snapshots and not yet deleted the old result.js files, purely to make this easier to review and reduce noise. To be clear, in this PR the result.js files are no longer being used, and I plan to remove them as soon as you are happy with the rest of the changes.
  • I was able to greatly simplify the execution of the assertions now that it relies on consistent tooling (see the createSnapshotTestBlock() helper function below).
  • The unreliable update-typescript-tests script is no longer necessary, as jest provides an effortless way to update the snapshots out of the box.

@JamesHenry JamesHenry requested a review from soda0289 June 5, 2017 00:32
Copy link
Member

@soda0289 soda0289 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! This should make it much easier to create tests.

@JamesHenry
Copy link
Member Author

Thanks, @soda0289! Updated to include the removals. As well as all the .result.js files, we actually had a lot of unused fixtures in there, so I have removed those too. I will merge when it successfully builds.

@JamesHenry JamesHenry merged commit 8062515 into master Jun 5, 2017
@JamesHenry JamesHenry deleted the snapshot-tests branch June 5, 2017 09:44
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