Learn How To Test With Vue.js !

Поделиться
HTML-код
  • Опубликовано: 1 дек 2024

Комментарии • 31

  • @ProgramWithErik
    @ProgramWithErik  6 лет назад +3

    Do you guys test your apps?

    • @davidbasil2727
      @davidbasil2727 6 лет назад +10

      Tests are like a school. You hate it but you need them to get a job.

    • @jofftiquez
      @jofftiquez 6 лет назад +6

      We don't. We like to live dangerously.

    • @ll931217
      @ll931217 6 лет назад +3

      Yip, I live dangerously and I am starting to feel like I have had enough which led me here...

    • @AlessandroMadruga
      @AlessandroMadruga 6 лет назад +1

      Yes, but why the hell this is so painfull in JS world? (vuejs in my case). I'm used to python.

    • @dallas-cole
      @dallas-cole 6 лет назад +2

      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.

  • @seidenada526
    @seidenada526 6 лет назад +2

    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").

    • @ProgramWithErik
      @ProgramWithErik  6 лет назад

      Thanks for the clarification!

    • @seidenada526
      @seidenada526 6 лет назад +1

      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.

  • @pcostarg
    @pcostarg 6 лет назад

    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?

  • @davidbasil2727
    @davidbasil2727 6 лет назад +1

    Hey whats up Erik? What do you think about Ruby on Rails in 2018?

    • @ProgramWithErik
      @ProgramWithErik  6 лет назад

      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

    • @davidbasil2727
      @davidbasil2727 6 лет назад

      Program With Erik Thanks for reply Erik

  • @dandoyon7416
    @dandoyon7416 6 лет назад

    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

    • @ProgramWithErik
      @ProgramWithErik  6 лет назад

      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.

    • @dandoyon7416
      @dandoyon7416 6 лет назад

      Thanks for speedy response Erik

  • @dean6046
    @dean6046 6 лет назад

    Thanks Erik, this is useful info. Ran into a few errors with webpack unfortunately. I have to check whats happening..

  • @rohithknarayan4006
    @rohithknarayan4006 4 года назад

    when i start the test it says "cannot use import outside a module" somebody please help me

  • @rwuttke
    @rwuttke 6 лет назад +1

    Hey Erik, have you looked at Cypress.io? This is an interesting testing suite.
    Note: I am not affiliated with Cypress.io at all.

  • @lokenderossii
    @lokenderossii 5 лет назад +4

    Code starts at 10:25

  • @makxell
    @makxell 4 года назад

    mocha-webpack stoped activity recently and the community forked the project as Mochapack. Use Mochapack instead of mocha-webpack

  • @AndersonSilvaMMA
    @AndersonSilvaMMA 6 лет назад +1

    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.

    • @ProgramWithErik
      @ProgramWithErik  6 лет назад

      LOL, thanks for the feedback

    • @tech-nomade
      @tech-nomade 5 лет назад +1

      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.

  • @velopia
    @velopia 6 лет назад

    AMP/PWA Vue/Nuxt Feathers series please
    It would be great

  • @metagamingOficial
    @metagamingOficial 5 лет назад

    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!