Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Improve Vuex test #37

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

Merged
afontcu merged 2 commits into testing-library:master from afontcu:master
Jun 3, 2019
Merged

Improve Vuex test #37

afontcu merged 2 commits into testing-library:master from afontcu:master
Jun 3, 2019

Conversation

@afontcu
Copy link
Member

@afontcu afontcu commented Jun 2, 2019

👋

When started working with VTL, I remember Vuex was one of the pain points when testing my components.

So in this PR I did a couple of things:

  1. I created "a store" by moving the object to an external file and importing it (as a developer would in a real project). For that I created a /Store folder to match the Router tests structure.
  2. I used the render wrapped pattern to showcase how to create isolated tests. I also wrote about it, so people can understand the reasoning behind the code. In the current implementation of Vuex testing examples, swapping the first two tests makes one of them fail (because of shared state).

As usual, this PR is just a proposal. I'm totally open to improvements and tweaks :)

@afontcu afontcu requested a review from dfcook June 2, 2019 20:25
@afontcu afontcu merged commit e97ac1d into testing-library:master Jun 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@dfcook dfcook dfcook approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /