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: Add "Write Vue code that's easy to test" section #34

Open
afontcu opened this issue Jun 7, 2020 · 1 comment
Open

feat: Add "Write Vue code that's easy to test" section #34

afontcu opened this issue Jun 7, 2020 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@afontcu
Copy link
Member

afontcu commented Jun 7, 2020

I was thinking of adding a section somewhere with several tips on writing testable code:

  • Extract requests into services to simplify mocking.
  • Extract complex methods and test them in isolation.
  • Do not test implementation details (with examples).
  • Build small things to have simpler test scenarios.
  • Write tests before writing production code (the ultimate technique to write testable code 😆).

Also, we could point to some smells:

  • Large "setup/arrange" blocks on each test.
  • Breaking tests on a refactor (from my POV this is critical but I'm not 100% sure it would fit in this section).

Sounds cool? More ideas?

disclaimer: There's a lot of content on the internet about these topics. I think this section should be focused on Vue stuff with Vue examples, and then maybe links to well-established content.

@lmiller1990
Copy link
Member

These are definitely useful.

I think we should focus on the Vue specific things first, though - like you said, there is a lot of content out there for the other topics.

That said, I definitely like this idea.

@afontcu afontcu added the documentation Improvements or additions to documentation label Jan 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants