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

[Question] Adding tests #216

Open
luetm opened this issue Feb 20, 2024 · 2 comments
Open

[Question] Adding tests #216

luetm opened this issue Feb 20, 2024 · 2 comments
Labels
Question Question about this project

Comments

@luetm
Copy link
Contributor

luetm commented Feb 20, 2024

Hey Chris!

As mentioned in #212 I looked into adding tests. I think a pure unit testing approach is difficult here, because the whole thing depends on the Blazor runtime to do its thing with cascading parameters, lifetime events, ...

So to explore the possibilities a bit, I went down 2 routes:

  • UI testing with Playwright
  • Unit testing with bunit

You can take a look at the (very much draft) code here: https://github.com/luetm/FluentValidation_Tests/tree/main/tests

I prefer the bunit, because it's much less code, has fewer dependencies, fewer moving parts, and runs faster.

If you generally agree with that approach, I would now create tests for all the features and test if they work as advertised. What do you think? 🙂

@luetm luetm added Question Question about this project Triage Issue needs to be triaged labels Feb 20, 2024
@chrissainty
Copy link
Member

This is great @luetm! Definitely go with bUnit it was design to do exactly this. It's what I use on some of the other Blazored projects and Egil is also a friend :)

@chrissainty chrissainty removed the Triage Issue needs to be triaged label Feb 20, 2024
@luetm
Copy link
Contributor Author

luetm commented Feb 22, 2024

@chrissainty Cool library! Was really interesting to be able to test components like that! The results are in a PR here #218 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question Question about this project
Projects
None yet
Development

No branches or pull requests

2 participants