How to mock an npm package with Vitest/Jest

Поділитися
Вставка
  • Опубліковано 12 січ 2025

КОМЕНТАРІ • 18

  • @nikolovlazar
    @nikolovlazar  5 місяців тому +4

    Hope you like this video! I got confused when I tried mocking the nanoid package the first time, so I thought I'd record this so you don't have to spend time figuring it out. Make sure to watch until the end because there are two solutions, not just one (like I mention in the video 😂). Thanks for watching! Don't forget to like and sub if you like content like this 🙏

    • @AHMEDYASSER-up6yx
      @AHMEDYASSER-up6yx 5 місяців тому

      @@nikolovlazar bro your whole channel is phenomenal I discovered from web dev Cody when he suggested the video implementing clean architecture. Thanks

    • @nikolovlazar
      @nikolovlazar  5 місяців тому

      @@AHMEDYASSER-up6yx Thanks!

  • @evanfang6573
    @evanfang6573 14 годин тому +1

    Thanks for sharing this. 👍

  • @dev-vf5fm
    @dev-vf5fm 16 днів тому +1

    I appreciate this helpful video but one thing to point out, I hate tutorials that doesn't include a warning for the side effects of what they are teaching in a crash course and most of them when the video got many views, they won't even correct it or change the content. Just like in this video at solution #1, but it's also great that it is corrected in solution #2. Kudos!

  • @dylanpalmboom2971
    @dylanpalmboom2971 4 місяці тому

    This helped me a lot, thanks 🙂👍

  • @itachi6352
    @itachi6352 5 місяців тому

    Letss goo, mocking data from queries is the same trouble. Been dealing with jest from the beninging and im only in this field for a year now. Testing is rly important where hundreds of players play on the same field. With tests we controll the behavior and its a legit thing. Happy hacking and salute from Macedonia

    • @itachi6352
      @itachi6352 5 місяців тому

      Ps. Love the setup

  • @SayfSentinel
    @SayfSentinel 5 місяців тому

    Bro, how come I just discovered your channel
    Your setup is leet. I use neovim tmux, only backend tho with typescript and sometime Golang
    Is that keyboard a voyager ? Are you still using qwerty for the vim keybind or using another layout ?
    Keep it up bro, your videos are pur gold

    • @nikolovlazar
      @nikolovlazar  5 місяців тому

      Thank you so much! Honestly I'm looking to get into Go 😅
      The keyboard is the voyager, yes, but I use the "Ugreen" magnetic phone holders to tent it at that angle.
      QWERTY. I tried Colemak last year, but I decided it's not worth it. Qwerty's good enough. Here's my layout: configure.zsa.io/voyager/layouts/4aAyM/latest/0

  • @mhdyousuf3392
    @mhdyousuf3392 5 місяців тому

    Hi Lazar, I have been watching your live on Clean Architecture and i loved it.
    can you create a long video building enterprise level application from scratch?
    a humble request from a subscriber😊

    • @nikolovlazar
      @nikolovlazar  5 місяців тому

      Thanks! I will be releasing a course soon that puts all of my CA learnings into use by building an app. It's not going to necessarily be an enterprise-level app though. I'll keep it simple so the course doesn't end up as long as my streams 😅

  • @AHMEDYASSER-up6yx
    @AHMEDYASSER-up6yx 5 місяців тому

    Please can you make a vitest and react testing library masterclass for Next.js , Iam struggling

    • @nikolovlazar
      @nikolovlazar  5 місяців тому

      In what parts exactly are you struggling?

    • @AHMEDYASSER-up6yx
      @AHMEDYASSER-up6yx 5 місяців тому

      @@nikolovlazar testing in general using vitest and react testing library I tried to learn it and implement it . several times but in vain

    • @AHMEDYASSER-up6yx
      @AHMEDYASSER-up6yx 5 місяців тому

      @@nikolovlazar so please can you make a testing course

    • @nikolovlazar
      @nikolovlazar  5 місяців тому +2

      @@AHMEDYASSER-up6yx I'll have this in mind. It would be cool to work on a "testing best practices" content. Thanks!

    • @muthukumar604
      @muthukumar604 5 місяців тому

      @@nikolovlazar setup process kills me