Yes. We spent a lot of time trying to get ahead of the test deficit to get our asses on TDD. I can tell it realy pays off, in ways you cannot imagine when starting to do it/hate it. Peace.
Quick note about the 'it' function of the test framework: it is supposed to guide the developer in writing assertions about the component being tested, i.e. it('shows a welcome title', ... This leads to better understanding of what the test is actually checking (instead of a generic "it testing Hello World").
Hi Erik, Why did you jump the vuejs testing scaffolding at the begining and does your manual installation of the testing tools give the same output as the scaffolding one from vue-cli?
I couldn't really comment, I don't do much Ruby on rails. I know competitors like Phoenix/Erlang are being talked about a lot. Java Spring Boot could be a good alternative too
Hey Erik, we're in the process of moving to Vue and have setup karma but I wanted to know how this test stack will scale. With our current angularjs 1.5 stack the startup of the testing is takes over a minute (which seems like an eternity) and things seem really sluggish when having a watcher and constantly running tests. And so you end up focusing specs a lot. From what I've read, it is related to webpack and number of components you have. Can you comment. Thanks
In my experience, doesn't matter if you're on Vue, Angular, React etc, tests will start taking a long time to run as you add more and more to your test suite and your app grows. It will probably be sluggish and slow when you start hitting dozens of components all with their own unique unit tests. Now, it's lighting faster then e2e tests, if that helps.
It's actually easy to explain why you need testing: as soon as your app gets bigger, some minor changes WILL brake elsewhere the functionality (nobody can remember everything you've written two, three or even six months ago, so it's granted that there will be brakes in functionality on almost every update of the app) and you will not be able to check manually (in the browser) whether everything in the app still works or not after any minor change.
Thanks for the tutorial bro. Would like to mention that I stumbled into an error not yet fixed (from this date) but already issued on GitHub (github.com/JeffreyWay/laravel-mix/issues/1748) . The workaround was to declare "window.Date = Date;" statement at the last line of the setup.js file. Another error that I got after running "npm test" was that the component I was trying to test was complaining that @vue/test-utils could not be found. Had to re-install it by using "npm install --save-dev @vue/test-utils". Hope that this may clarify anyone who may stumble into this in the future. Cheers!
Do you guys test your apps?
Tests are like a school. You hate it but you need them to get a job.
We don't. We like to live dangerously.
Yip, I live dangerously and I am starting to feel like I have had enough which led me here...
Yes, but why the hell this is so painfull in JS world? (vuejs in my case). I'm used to python.
Yes. We spent a lot of time trying to get ahead of the test deficit to get our asses on TDD. I can tell it realy pays off, in ways you cannot imagine when starting to do it/hate it.
Peace.
Quick note about the 'it' function of the test framework: it is supposed to guide the developer in writing assertions about the component being tested, i.e. it('shows a welcome title', ... This leads to better understanding of what the test is actually checking (instead of a generic "it testing Hello World").
Thanks for the clarification!
Wow! Thank you for the heart =p And I should say that all credits are for Jeffrey Way from laracasts.com, very good tutorials too.
Hi Erik, Why did you jump the vuejs testing scaffolding at the begining and does your manual installation of the testing tools give the same output as the scaffolding one from vue-cli?
Hey whats up Erik? What do you think about Ruby on Rails in 2018?
I couldn't really comment, I don't do much Ruby on rails. I know competitors like Phoenix/Erlang are being talked about a lot. Java Spring Boot could be a good alternative too
Program With Erik Thanks for reply Erik
Hey Erik, we're in the process of moving to Vue and have setup karma but I wanted to know how this test stack will scale. With our current angularjs 1.5 stack the startup of the testing is takes over a minute (which seems like an eternity) and things seem really sluggish when having a watcher and constantly running tests. And so you end up focusing specs a lot. From what I've read, it is related to webpack and number of components you have. Can you comment. Thanks
In my experience, doesn't matter if you're on Vue, Angular, React etc, tests will start taking a long time to run as you add more and more to your test suite and your app grows. It will probably be sluggish and slow when you start hitting dozens of components all with their own unique unit tests. Now, it's lighting faster then e2e tests, if that helps.
Thanks for speedy response Erik
Thanks Erik, this is useful info. Ran into a few errors with webpack unfortunately. I have to check whats happening..
when i start the test it says "cannot use import outside a module" somebody please help me
Hey Erik, have you looked at Cypress.io? This is an interesting testing suite.
Note: I am not affiliated with Cypress.io at all.
I have not looked at it. Looks interesting
Code starts at 10:25
mocha-webpack stoped activity recently and the community forked the project as Mochapack. Use Mochapack instead of mocha-webpack
Aww good to know! Thanks
Don't want to be negatively or something like this, but I feel like you don't explain why we need testing, what's the need for it.
LOL, thanks for the feedback
It's actually easy to explain why you need testing:
as soon as your app gets bigger, some minor changes WILL brake elsewhere the functionality (nobody can remember everything you've written two, three or even six months ago, so it's granted that there will be brakes in functionality on almost every update of the app) and you will not be able to check manually (in the browser) whether everything in the app still works or not after any minor change.
AMP/PWA Vue/Nuxt Feathers series please
It would be great
OK! I'll take a look !
Thanks for the tutorial bro. Would like to mention that I stumbled into an error not yet fixed (from this date) but already issued on GitHub (github.com/JeffreyWay/laravel-mix/issues/1748) . The workaround was to declare "window.Date = Date;" statement at the last line of the setup.js file.
Another error that I got after running "npm test" was that the component I was trying to test was complaining that @vue/test-utils could not be found. Had to re-install it by using "npm install --save-dev @vue/test-utils". Hope that this may clarify anyone who may stumble into this in the future. Cheers!