Angular Unit Testing Course - All That You Need to Know About Testing

Sdílet
Vložit
  • čas přidán 11. 06. 2024
  • ► CHECK THE FULL ANGULAR UNIT TESTING COURSE - monsterlessons-academy.com/co...
    Welcome to my Angular unit testing course. This course covers all knowledge about Angulae unit testing and E2E testing. You will learn testing utilities, services, components and event NgRx. You will learn how to test RxJS, mock Http requests, use spy and mocks and much more. We will also test fully a real project so you'll see how it works in reality. By the end of this course you will be prepared to test any Angular project.
    TIMESTAMPS
    0:00 Start
    0:18 Introduction
    1:33 Why testing?
    4:05 Source code
    4:36 Setting up Node and Angular
    8:09 What is unit testing
    9:53 Setting up Jest
    14:41 Testing utilities
    25:31 Basic service testing
    34:49 Mock and Spy
    46:38 Testing RxJS streams
    51:16 Testing HTTP in Angular
    01:04:29 Testing HTTP errors
    ► CHECK MY COURSES - monsterlessons-academy.com/co...
    MOST POPULAR COURSES
    ► Javascript interview questions - monsterlessons-academy.com/co...
    ► Typescript interview questions - monsterlessons-academy.com/co...
    ► React interview questions - monsterlessons-academy.com/co...
    ► Angular Interview Questions monsterlessons-academy.com/co...
    ► Building real project with Angular + NgRx - monsterlessons-academy.com/co...
    ► Building real NestJS API - monsterlessons-academy.com/co...
    ► Building real fullstack project - monsterlessons-academy.com/co...
    ► Mastering Git - monsterlessons-academy.com/co...
    ► Mastering Docker and Docker Compose - monsterlessons-academy.com/co...
    FOLLOW ME
    ► TWITTER - / monster_lessons
    ► INSTAGRAM - / monsterlessonsacademy
    ► TIKTOK - / monsterlessonsacademy

Komentáře • 39

  • @FinanzMinimalist
    @FinanzMinimalist Před 4 měsíci +7

    Awesome! This comes to the right time :) Please keep up the great content.

  • @marcogrillo3396
    @marcogrillo3396 Před 14 dny

    This is definitely the BEST course on Angular Testing. I also bought your full course.
    Thank you, keep up the good work!

  • @uaplatformacomua
    @uaplatformacomua Před 3 měsíci

    Awesome course, thank you

  • @peter3818
    @peter3818 Před 16 dny

    As far as I know, you can simply destructure the 'expect' function from the callback parameter object inside 'it', in order to make it work with asynchronous code. Something like this:
    it('should expect asynchronously', ({ expect }) => {api.getTags().subscribe((response) => { expect(response).toBeTruthy(); })})
    But maybe this is just working with vitest, don't know for sure. Anyways, thanks for the content!

  • @ngathanh8438
    @ngathanh8438 Před 3 měsíci

    thanks

  • @sergeu90
    @sergeu90 Před 4 měsíci

    For react will be useful also

  • @mma-dost
    @mma-dost Před 4 měsíci +2

    Please upload for react too and next js.

    • @sergeu90
      @sergeu90 Před 4 měsíci +1

      I want also for react.

    • @mma-dost
      @mma-dost Před 4 měsíci

      you too comment maybe he will read yours he havent replied to mine comment

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  Před 3 měsíci +1

      Thank you. I will add it in the list of ideas for the next course

    • @mma-dost
      @mma-dost Před 3 měsíci

      thanks a lot sir @@MonsterlessonsAcademy

  • @user-sm9ho4zy6o
    @user-sm9ho4zy6o Před 2 měsíci

    What is the purpose of mocking the http response and testing that the response is equal to the moked one we provided? Shouldn't it always pass? I can't understand what we are testing there

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  Před 2 měsíci +1

      There is no purpose in that. We test what our function returns. After API call we might do data transformations and we want to know if we get them in the format how we expect.

    • @user-sm9ho4zy6o
      @user-sm9ho4zy6o Před 2 měsíci

      @@MonsterlessonsAcademy Ok, thank you for the response, i didn't get the logic!

  • @ucretsiztakipci6612
    @ucretsiztakipci6612 Před 3 měsíci

    35:00

  • @valerio9851
    @valerio9851 Před 3 měsíci

    I followed this video till minute 21 and I am stuck. I have this error when running the test: ({"Object.":function(module,exports,require,__dirname,__filename,jest){import { range } from './utils';
    ^^^^^^
    SyntaxError: Cannot use import statement outside a module
    at Runtime.createScriptFromCode (node_modules/jest-runtime/build/index.js:1505:14)
    Test Suites: 1 failed, 1 total
    Tests: 0 total
    Snapshots: 0 total
    Time: 0.916 s
    Ran all test suites. I can't fix it. can you help me please?

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  Před 3 měsíci

      Unfortunately I can't help without debugging your code.

    • @ThisLineCrossed
      @ThisLineCrossed Před 13 dny

      Are you sure you have not nested the import-Statement somewhere? Did you correctly place the import in the beforeEach function? Any syntax errors or anything else like that?

  • @DarrellGamble-bi4up
    @DarrellGamble-bi4up Před 2 měsíci

    Would this work with Angular 14?

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  Před 2 měsíci +1

      Yes. The only difference is that standalone components are not there yet but it doesn't change anything. You inject a component in the test in another way. This is it.

    • @DarrellGamble-bi4up
      @DarrellGamble-bi4up Před 2 měsíci

      You're a great presenter. Keep doing what you do!@@MonsterlessonsAcademy

  • @lewiemarks6418
    @lewiemarks6418 Před 6 dny

    Why does nothing work when i follow setup guides to the T. getting some bullshit error about must use import in testing.mjs...

    • @mickelsie5461
      @mickelsie5461 Před 5 dny

      That is when you learn the most. You don't learn much following these to the T. There is a very good reason that this industry pays well. It is not easy. If it were everyone would do it and very few would make good money. Embrace the struggle 💪🏼

    • @lewiemarks6418
      @lewiemarks6418 Před 5 dny

      Problem is, I’m dumb as fuck 😂

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  Před 5 dny

      Just for you to know that in the full course you get source code to each lesson and I help with debugging all your problems across the course.

    • @mickelsie5461
      @mickelsie5461 Před 5 dny

      ​@lewiemarks6418, we are all pretty dumb. It's really about being patient and persevering. Just keep it up day in day out. After a few years you will look back and see great results. No meaningful achievement ever comes without hard work and sacrifice.

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  Před 5 dny

      @@mickelsie5461 100% agree. Consistency is a key. Btw even after 13 years of experience the last bug that I had took 3 months to debug. So it takes time -_-

  • @uaplatformacomua
    @uaplatformacomua Před 3 měsíci +1

    It lacks the link to github with this code...

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  Před 3 měsíci +2

      It's a part of the paid course. You get access to the code under every single video inside a full course

    • @uaplatformacomua
      @uaplatformacomua Před 3 měsíci

      @@MonsterlessonsAcademy Oh, I see. Thank you ☺️

  • @user-ve2hg9cp1k
    @user-ve2hg9cp1k Před měsícem

    where is the source code?

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  Před měsícem +1

      As this is a part of the full course you get access to the course code of each video inside the course.