Master NextJS testing with Vitest and React Testing Library || web boss

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

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

  • @HayetFellah
    @HayetFellah 9 месяцев назад

    Hi, would you happen to know how to mock next/dynamic and test components which dynamically import other components ? Great video btw :D

  • @jervx829
    @jervx829 7 месяцев назад

    Hi I'm new to testing, since Nextjs contains both front-end and back end, how can we test both?
    If I set the environment to jsdom some of my tests in api/ doesn't work as they require some node/serverside lib/functionality
    but when I change the environment to node the front end test fails.

  • @0xtz_
    @0xtz_ 5 месяцев назад

    i have trpc and wen i run the test I'm getting :
    > Render Documents Module
    TRPCClientError: `cookies` was called outside a request scope.

    • @webboss
      @webboss  5 месяцев назад +1

      Hi, you will need a mechanism for intercepting your trpc requests and stubbing your responses. I use mock service worker for REST APIs but not quite sure if it supports trpc.

    • @0xtz_
      @0xtz_ 5 месяцев назад

      @@webboss hmmm 🤔
      thanks man I ll check
      I think bc I have auth not sure but lemme keep checking Google

  • @end2399
    @end2399 8 месяцев назад

    Great video!

    • @webboss
      @webboss  5 месяцев назад

      Thanks!