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

Add golden/snapshot testing #60

Merged
merged 1 commit into from
Jan 28, 2022
Merged

Add golden/snapshot testing #60

merged 1 commit into from
Jan 28, 2022

Conversation

samhh
Copy link
Contributor

@samhh samhh commented Jan 27, 2022

Closes #35. Thanks @Magellol for your initial outlay!

This PR adds golden/snapshot testing with an example test migration included. There's no longer any need to write the expected output code, merely verify prior to committing that it looks correct.

It outputs .ts files, so we get syntax highlighting and per @Magellol's suggestion in the linked issue we could pursue typechecking these perhaps as a CI step. If a test fails the output will be the printed error(s).

I believe the gitignore pattern is safe provided we always include an actual prefix in our actualFile outputs.

@samhh samhh requested a review from a team as a code owner January 27, 2022 22:23
@samhh samhh requested a review from OliverJAsh January 27, 2022 22:23
@samhh samhh merged commit 6384359 into master Jan 28, 2022
@samhh samhh deleted the golden branch January 28, 2022 11:32
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.

Snapshot testing
2 participants