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

feat/improve testing #463

Merged
merged 21 commits into from
Oct 25, 2024
Merged

feat/improve testing #463

merged 21 commits into from
Oct 25, 2024

Conversation

brianmcgee
Copy link
Member

@brianmcgee brianmcgee commented Oct 21, 2024

I've gone through root_test.go doing some clean up and refinements to how we test.

One highlight is the introduction of a better treefmt helper which allows us to do things like this:

treefmt(t,
	withArgs("elm/elm.json", "haskell/Nested/Foo.hs"),
	withNoError(t),
	withStats(t, map[stats.Type]int{
		stats.Traversed: 2,
		stats.Matched:   2,
		stats.Formatted: 0,
		stats.Changed:   0,
	}),
)

Another is using the test-fmt-append formatter more to generate changes and clarify how the caching behaviour should work in some tests.

Closes #459

Signed-off-by: Brian McGee <[email protected]>
Signed-off-by: Brian McGee <[email protected]>
Signed-off-by: Brian McGee <[email protected]>
Signed-off-by: Brian McGee <[email protected]>
Signed-off-by: Brian McGee <[email protected]>
@brianmcgee brianmcgee requested review from zimbatm and jfly October 21, 2024 10:34
Signed-off-by: Brian McGee <[email protected]>
Copy link
Member

@zimbatm zimbatm left a comment

Choose a reason for hiding this comment

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

amazing

@brianmcgee brianmcgee merged commit 8cc688b into main Oct 25, 2024
27 checks passed
@brianmcgee brianmcgee deleted the feat/improve-testing branch October 25, 2024 05:16
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.

Cleanup how we test for changes
2 participants