Angular Testing Quick Start

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 ธ.ค. 2017
  • Get started testing Angular 5 with Jasmine and Karma. This video covers basic testing component TDD concepts as well as 3rd party services like Firebase. angularfirebase.com/lessons/a...
    Jasmine: jasmine.github.io/
    Testing Docs: angular.io/guide/testing
    Great Article: / tdd-the-rite-way
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 98

  • @bonzo6989
    @bonzo6989 3 ปีที่แล้ว +100

    Man... testing Angular is harder than coding Angular 😎

    • @atharvdeshmukh1730
      @atharvdeshmukh1730 2 ปีที่แล้ว +2

      Exactly its way harder.

    • @spankyspork5808
      @spankyspork5808 ปีที่แล้ว

      Use the suite-slimmer npm package for angular, makes it a lot easier

  • @monfernape
    @monfernape 3 ปีที่แล้ว +14

    I've already hesitating going towards testing. Thank you for creating such as mesmerizing video explaining tests.

  • @massinissachaouchi4595
    @massinissachaouchi4595 10 หลายเดือนก่อน

    You rock man, I was looking at the documentations of both Angular and Jasmine to understand the spec file in my components. You made me save a lot of time. I still have to rtfm of course but your video helps a lot ! 😊

  • @tsortanidischristos412
    @tsortanidischristos412 6 ปีที่แล้ว +8

    Wow I've been waiting for a high quality video teaching testing!

  • @jamesbarrow
    @jamesbarrow 6 ปีที่แล้ว +6

    Just the kind of content I was looking for, thank you

  • @zoecarlibur
    @zoecarlibur 5 ปีที่แล้ว +12

    It's amazing how he breaks down these things.

  • @pashweetie
    @pashweetie 4 ปีที่แล้ว +2

    Thank you my guy. Literally the only helpful thing i've seen on this topic

  • @CubeAmaterasu
    @CubeAmaterasu 3 ปีที่แล้ว +9

    Ill Keep testing my app manually for now xd

  • @Gustavo-ye1ko
    @Gustavo-ye1ko 5 ปีที่แล้ว +1

    Strong and effective pill to learn angular testing, thanks! :)

  • @Gustavo-ye1ko
    @Gustavo-ye1ko 5 ปีที่แล้ว +19

    7:19 understood, but what if you don't know how long the delay will be? (which is the case in almost 100% of async stuff) is there a way to monitor that?

    • @wot0gold
      @wot0gold 4 ปีที่แล้ว +1

      Have you figured out how to deal with such like cases?

    • @NoorAlDinAhmed
      @NoorAlDinAhmed 4 ปีที่แล้ว +1

      @@wot0gold timeouts

    • @tranhuuthu991990
      @tranhuuthu991990 3 ปีที่แล้ว

      using DoneFn and subscribe to observable and expect result to matcher then call done.

    • @dewinchy
      @dewinchy 3 ปีที่แล้ว +4

      I think the answer is: you're always testing code by faking/mocking the dependencies. So you would fake or mock the async calls too, this mean, async calls that wait a certain time like in that video, you would fake that by tick(). You would also fake e.g. HTTP calls for example, so these wouldn't really take an unknown amount of time in your test, but only a faked amount of time or mostly: no time, because, the fake service would return the results asap.

  • @kamalsk8023
    @kamalsk8023 4 ปีที่แล้ว

    Very helpful, thank you so much for easy explanation.

  • @005yass
    @005yass 6 ปีที่แล้ว +8

    Thanks alot for your work i was waiting for this video

    • @Fireship
      @Fireship  6 ปีที่แล้ว +2

      I said I would make this video six months ago, so glad to finally have it done. Thank you.

  • @DerRobert28
    @DerRobert28 11 หลายเดือนก่อน +1

    My Angular app is not shown in the test runner .... what do I have to configure or what do I have to make sure in my test cases (in the spec.ts files)?

  • @JustThink2000
    @JustThink2000 5 ปีที่แล้ว +2

    This was helpful, thank you.

  • @redskater42
    @redskater42 5 ปีที่แล้ว

    The observable of our message in the .spyOn() method. How can we use this in message body is always dynamic? Or should test be if the message body was loading into the html?

  • @tjscorp
    @tjscorp 5 ปีที่แล้ว +7

    Whoa!!! I am not ready for this!!

  • @JustThink2000
    @JustThink2000 5 ปีที่แล้ว

    How would you write a spec that reads from an observable's header(s)?

  • @alperozel
    @alperozel 5 ปีที่แล้ว +1

    very helpful, thanks.

  • @belmiris1371
    @belmiris1371 5 ปีที่แล้ว +1

    Thanks for this.

  • @souvikdatta97
    @souvikdatta97 2 ปีที่แล้ว

    If I want to use a different browser than chrome what to do? I have Edge and Brave installed in my system.

  • @mavbloopy
    @mavbloopy 6 ปีที่แล้ว +1

    Thank you!

  • @dairdr
    @dairdr 6 ปีที่แล้ว

    Excellent content

  • @superbanane4768
    @superbanane4768 2 ปีที่แล้ว

    Hi, where can i find the paper shown in the beginning? Tanks.

  • @mlntdrv
    @mlntdrv 3 ปีที่แล้ว +2

    This was TDD? Weren't you supposed to write the test first, see it red, then write the code that turns it green?

  • @farsabbutt
    @farsabbutt 6 ปีที่แล้ว +1

    awesome thankyou!

  • @patrickmullot73
    @patrickmullot73 6 ปีที่แล้ว +2

    Great Video, thanks!!

    • @Fireship
      @Fireship  6 ปีที่แล้ว

      Thanks for watching :)

  • @PMANOBRE
    @PMANOBRE 6 ปีที่แล้ว +2

    Hi Jeff. I absolutely love the info you share. It's practical and applicable in real life situations. Are you thinking to share in the near future more videos about Firestore ? Can you do the Roled-based user permissions for Firestore, Firestore Database rules and How to connect Firestore users to their Data, like you did with Realtime Database ? Thanks in advance.

    • @Fireship
      @Fireship  6 ปีที่แล้ว +2

      Thank you. Yes, Roled-based user permissions for Firestore is next on the list.

  • @AP-eh6gr
    @AP-eh6gr 4 ปีที่แล้ว

    At the 7th minute mark i changed from 1.5x to 0.75x :D
    But this was really helpful. big thanks.

  • @brendan2240
    @brendan2240 3 ปีที่แล้ว

    Great video 👌

  • @mateenahmedkhan3780
    @mateenahmedkhan3780 4 ปีที่แล้ว +2

    bro , this was amazing tutorial, also please provide the code that you have written above, like in a github repo!

  • @pemessh
    @pemessh 5 ปีที่แล้ว

    Great video

  • @AA9Milan
    @AA9Milan 6 ปีที่แล้ว +1

    Great work like always. How can I test a login function in angularfire? Anybody have an idea?

  • @MrCottonlion
    @MrCottonlion 4 ปีที่แล้ว

    This is really good

  • @TecnoTubeTutorials
    @TecnoTubeTutorials 4 ปีที่แล้ว

    awesome thank you

  • @subhajitdas2784
    @subhajitdas2784 6 ปีที่แล้ว

    What is the icon pack you are using for VSCode ?? it looks cool

    • @Fireship
      @Fireship  6 ปีที่แล้ว +1

      I use vscode-icons + atom-one-dark for syntax.

  • @h1ghpower
    @h1ghpower 5 ปีที่แล้ว +65

    Just use TH-cam speed features noobs... 0.75x should do it :p

    • @outtabubblegum7034
      @outtabubblegum7034 5 ปีที่แล้ว +18

      I'm using 2x.

    • @SarahAlbinda
      @SarahAlbinda 4 ปีที่แล้ว +1

      This is good advice actually.

    • @michalstan
      @michalstan 4 ปีที่แล้ว

      I tried that but it sounds scary :-O

    • @Saurabh2816
      @Saurabh2816 4 ปีที่แล้ว

      1. Download the video.
      2. Play it in VLC.
      3. Use ' [ ' shortcut to slow the video speed.

    • @HK-sw3vi
      @HK-sw3vi 3 ปีที่แล้ว +1

      some may need to watch it 4 times on 0.25

  • @Poohbify
    @Poohbify 5 ปีที่แล้ว +7

    I am curious, how useful is this as a front-end developer?

    • @tejasautkar4184
      @tejasautkar4184 3 ปีที่แล้ว +2

      Believe me, it is one of the most important skills to acquire

    • @massinissachaouchi4595
      @massinissachaouchi4595 10 หลายเดือนก่อน +1

      You use typescript to avoid bugs in your JavaScript code. Similary you use testing to validate behaviour of your components and services. That way you dont have to manualy test things and if you change something in your code the testing will tell if the exepcted behaviour of your components or service match the new version of the component or service.
      I am learning it right now and Testing seems as mandatory as a compiler error messages to make you software solid.

  • @giorgimerabishvili8194
    @giorgimerabishvili8194 4 ปีที่แล้ว

    Does Angular still use Protractor?

  • @damandeepsingh2460
    @damandeepsingh2460 5 ปีที่แล้ว

    How to write test cases for conditional statements like if else if, switch or for-loop ?

    • @theonlycatonice
      @theonlycatonice 5 ปีที่แล้ว

      According to various principles, you should never be using conditionals in unit tests
      stackoverflow.com/questions/27880631/why-should-you-avoid-conditional-logic-in-unit-tests-and-how
      and th-cam.com/video/vo6D9etWI4A/w-d-xo.html

  • @pankaj.parkar
    @pankaj.parkar 6 ปีที่แล้ว

    This is Nice

  • @The_Nova_Glow
    @The_Nova_Glow 4 ปีที่แล้ว

    I've never subscribed to fast!

  • @almiller7240
    @almiller7240 5 ปีที่แล้ว +10

    Excellent content. BUT PLEASE SLOW DOWN. :o)

  • @damianmartyniak3078
    @damianmartyniak3078 5 ปีที่แล้ว

    Little misspoke in 02:56, but for sure You can call it AngularButtonComponent. :p

  • @waqarabbas9407
    @waqarabbas9407 6 ปีที่แล้ว +2

    awesome..
    expecting some native mobile app please......
    thank you

  • @lalosalamanca1469
    @lalosalamanca1469 ปีที่แล้ว

    I like ur vscode theme what is it ?

  • @Marc-ox7fy
    @Marc-ox7fy ปีที่แล้ว

    Finally somebody without a funny accent!

  • @harshitpant3067
    @harshitpant3067 6 ปีที่แล้ว

    Which os that?

    • @Fireship
      @Fireship  6 ปีที่แล้ว +1

      Ubuntu

  • @nikhilverma4976
    @nikhilverma4976 5 ปีที่แล้ว +1

    Arent' you doing Behaviour driven development with Jasmine?

    • @franciscod5987
      @franciscod5987 5 ปีที่แล้ว

      BDD is a type of Test driven development

  • @Vedgy
    @Vedgy 4 ปีที่แล้ว

    What's the point of making a test to expect data from a service if you're just going to fake that same data in the test?

  • @nexus0709
    @nexus0709 6 ปีที่แล้ว +2

    Thats not are test driven development, is suppose you should create the tests first and then create the functionallity based on tests

  • @dustinphan6458
    @dustinphan6458 3 ปีที่แล้ว

    Great content! but it was hard to follow since you went through your content quite fast.

  • @mikeglobal9084
    @mikeglobal9084 6 ปีที่แล้ว

    I dont understand why should we need this karma, if we can just go and test manualy ...

    • @Fireship
      @Fireship  6 ปีที่แล้ว +6

      Karma runs your tests on every code change. Something fails, you know about it right away.

  • @smaudd7873
    @smaudd7873 3 ปีที่แล้ว

    Why does content has an async pipe on the template if its just a string?

  • @akhilnair1662
    @akhilnair1662 5 ปีที่แล้ว +9

    Just imagine, a beginner watching this video. It's way too fast for him.

    • @okie9025
      @okie9025 4 ปีที่แล้ว +1

      This isn't for beginners

  • @peterluxus7382
    @peterluxus7382 5 ปีที่แล้ว

    Firebase ... ts ts ts

  • @shrivernet1375
    @shrivernet1375 6 ปีที่แล้ว

    0of

  • @bushbuddyplatypus
    @bushbuddyplatypus 5 ปีที่แล้ว +1

    Not really a tutorial

  • @fentengshi9543
    @fentengshi9543 2 ปีที่แล้ว

    it is not a really good explanation bro, it looks like losing something in this video. ( for example: in HTML, the content | async will show wrong)

  • @farhadlavaei6675
    @farhadlavaei6675 2 ปีที่แล้ว

    Very very quickly, It's very bad :(

  • @somya5666
    @somya5666 6 ปีที่แล้ว +19

    Too fast to understand, take a pause man!!

    • @elaith9
      @elaith9 5 ปีที่แล้ว +11

      You can slow down video in your options. I see lots of people complaining about the speed which this guy is presenting with. I personally think it's awesome. I don't have whole day to watch 1 hour video of some dude talking about basic stuff with tons of erm, oh eh whatever and repating same shit over and over. Just go straight to the point and talk clearly just like this guy does. If it's too fast for you, slow it down in the settings pal.

    • @surajbathija843
      @surajbathija843 5 ปีที่แล้ว

      This should work
      th-cam.com/video/Yod3tBt0beM/w-d-xo.html

  • @AlouiMohamedhabib
    @AlouiMohamedhabib 5 ปีที่แล้ว +4

    Thanks for the video but unfortunately it does piss me off!
    I know how to test but with this pace i was unable to follow along!
    SLOW DOWWWWWN.

    • @massinissachaouchi4595
      @massinissachaouchi4595 10 หลายเดือนก่อน

      There is an option to slow down the video on TH-cam.

  • @deian85
    @deian85 5 ปีที่แล้ว +4

    Way too fast to understand what's going on. Little to no explanations

  • @tomekumb
    @tomekumb 5 ปีที่แล้ว +3

    Testing is the worst and most boring part of programming :/

  • @lutfigorkemturan159
    @lutfigorkemturan159 3 ปีที่แล้ว

    What is the point of making a beginner level video that fast? because it is cool, ego-boosting?

    • @massinissachaouchi4595
      @massinissachaouchi4595 10 หลายเดือนก่อน

      I am a beginner and I like that pace. I just look at it a first time and then pause the video as I code and look at the documentation.
      I prefer video that are quick because the documention is there for the details I just want to have a basic understanding of what I need, what will I do with the tool and how to do.

  • @DanielRamBeats
    @DanielRamBeats 4 ปีที่แล้ว

    this is not a very indepth explanation at all.