-
Notifications
You must be signed in to change notification settings - Fork 272
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
Upgraded vue-cli dependencies and added unit testing capabilities to the vue sample #164
Conversation
* Updated vue-cli dependencies to latest. Babel, jest, prettier work according to the latest developments now. * Added JEST and @vue/test-utils to the codebase. One example test was added. Coverage threshold can be set in the package.json file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, thanks!
Unfortunately, the vue-apollo
upgrade introduced a breaking change (https://github.com/Akryum/vue-apollo/releases) that is causing issues with SSR in Integrated Mode.
At present, I don't have the bandwidth to investigate and make the necessary changes to make vue-apollo
happy. So there are a couple options:
- Feel free to tackle the changes (if you're comfortable in that Vue/GraphQL/SSR space) and update the PR.
- Roll back the
vue-apollo
update. Though I'm not entirely sure thatbeta.27
is compatible with Vue 2.6.x.
Along with the above, I have one request and one question:
-
In
package.json
dependencies
anddevDependencies
, please change all version ranges to be prefixed with~
instead of^
. We have had too many suprises with dependencies being upgraded "silently" and inadvertently breaking the samples. Using~
doesn't completely solve this, but it helps without having to pin versions. -
Question- this is really nit-picky, but can the
coverageThreshold
options inpackage.json
be moved intojest.config.js
? We try to keep "plugin" configuration out of package.json where possible to keep things consistent across samples. Naturally, there can/may be exceptions, so if it's more standard practice in Vue-land to have thecoverageThreshold
options in package.json or if there's solid reasoning to do so, then so be it.
Reverted back to vue 2.5.22 and vue-apollo beta 27 for compatibility reasons. Also removed opinionated coverage threshold settings
@aweber1 thanks for your comment and the time spent on this.
Thanks |
Thank you for providing the changes. Unfortunately we have updated the dependencies without noticing this pull request. I`m closing this pr because the changes already been done. |
@sc-antonkulagin - we upgraded the dependencies, but what about the unit test portion of the PR? |
@anastasiya29 would it perhaps be better if I took the latest branch and add the tests? Merging this might be a challenge. |
@timbenniks It would be great if you can leave only changes related to tests. |
Will do. I will however make a new PR as merging a year of new code into my fork might not be very easy. |
@timbenniks I will close this PR, because you said that you will open another PR |
Description
I noticed there are the basics of setting up unit tests for both the react and angular samples. The vue sample lacked this. When I added JEST and @vue/test-utils there were a bunch of issues with babel trying to transpile the spec files. As it turns out the vue-cli base dependencies were a little outdated. I decided to create a new vue-cli project with the same settings as the Vue sample app but I added unit tests on top. This resulted in working code transpilation and in updated prettier rules. All is now in line with the latest vue industry standards.
Motivation
I think these samples should have as little opinion to them as possible but should not lack basics for unit tests. I have added the "vue way" of how unit tests are done. No restrictions are given on how the tests are to be written. Coverage it completely configurable.
How Has This Been Tested?
npm i
.jss test:unit
coverage/
I coded the PR on macOS Mojave with node 10.13.0 and npm 6.7.0.
The changes in the templates of certain vue files are because of the newest prettier rules.
Regression test done by checking all components. They still work.
Types of changes
Checklist: