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

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 ก.ค. 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

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

  • @FinanzMinimalist
    @FinanzMinimalist 5 หลายเดือนก่อน +7

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

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  4 หลายเดือนก่อน +1

      Thank you so much for your support. It means a lot to me!

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

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

  • @uaplatformacomua
    @uaplatformacomua 4 หลายเดือนก่อน

    Awesome course, thank you

  • @ngathanh8438
    @ngathanh8438 4 หลายเดือนก่อน

    thanks

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

    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!

  • @abhinav2554131
    @abhinav2554131 20 วันที่ผ่านมา

    Very well explained in just an hour i went from zero to being confident, however could you also suggest how to unit test the components?

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  18 วันที่ผ่านมา

      I cover everything about components testing including real project testing in the full course

  • @sergeu90
    @sergeu90 5 หลายเดือนก่อน

    For react will be useful also

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  4 หลายเดือนก่อน +1

      I will add it to the list of future courses

    • @sergeu90
      @sergeu90 4 หลายเดือนก่อน

      @@MonsterlessonsAcademy a lot of thanks

  • @mma-dost
    @mma-dost 5 หลายเดือนก่อน +2

    Please upload for react too and next js.

    • @sergeu90
      @sergeu90 5 หลายเดือนก่อน +1

      I want also for react.

    • @mma-dost
      @mma-dost 5 หลายเดือนก่อน

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

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  4 หลายเดือนก่อน +1

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

    • @mma-dost
      @mma-dost 4 หลายเดือนก่อน

      thanks a lot sir @@MonsterlessonsAcademy

  • @user-sm9ho4zy6o
    @user-sm9ho4zy6o 3 หลายเดือนก่อน

    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  3 หลายเดือนก่อน +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 3 หลายเดือนก่อน

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

  • @ucretsiztakipci6612
    @ucretsiztakipci6612 4 หลายเดือนก่อน

    35:00

  • @DarrellGamble-bi4up
    @DarrellGamble-bi4up 3 หลายเดือนก่อน

    Would this work with Angular 14?

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  3 หลายเดือนก่อน +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 3 หลายเดือนก่อน

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

  • @valerio9851
    @valerio9851 4 หลายเดือนก่อน

    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  4 หลายเดือนก่อน

      Unfortunately I can't help without debugging your code.

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

      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?

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

    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 หลายเดือนก่อน +1

      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 หลายเดือนก่อน

      Problem is, I’m dumb as fuck 😂

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

      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 หลายเดือนก่อน

      ​@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  หลายเดือนก่อน

      @@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 4 หลายเดือนก่อน +1

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

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  4 หลายเดือนก่อน +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 4 หลายเดือนก่อน

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

  • @user-ve2hg9cp1k
    @user-ve2hg9cp1k 2 หลายเดือนก่อน

    where is the source code?

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  2 หลายเดือนก่อน +1

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