Skocz do zawartości

Aktywacja nowych użytkowników
Zakazane produkcje

  • advertisement_alt
  • advertisement_alt
  • advertisement_alt
Courses2024

Mocking Techniques in Vitest

Rekomendowane odpowiedzi

84c53e5085d927e71a782a830f125ff5.jpeg
Released 10/2024
MP4 | Video: h264, 1920x1080 | Audio: AAC, 44.1 KHz, 2 Ch
Genre: eLearning | Language: English | Duration: 48 Lessons ( 1h 31m ) | Size: 420 MB
Learn to mock functions, time, globals, network, and modules. Practice real-world scenarios using Vitest to write effective and maintainable tests.
First, you need to know what to mock. Then, find the right way to mock that thing so it doesn't compromise your test suite. Over-mock, and your tests become pointless. Under-mock, and they get brittle instead.

In either case, you put in so much effort, and you don't feel like you're getting much in return.
This is where Artem comes in. He's been proving developer misconceptions around mocking wrong for nearly a decade, and he's here to make you a mocking pro.
Free Download What You'll Learn
In this hands-on workshop, you'll learn
The purpose of mocking;
What to mock and when;
How to write mocks that bring value instead of being a maintenance chore;
How to separate your mocks from implementation details;
Type safety strategies for your mocks;
And all the mocking techniques you will need to test your code!
By solving targeted, real-world problems using the Vitest framework, you'll gain a comprehensive understanding of mocking and finally unlock it as a useful tool in your testing arsenal.
Workshop Structure
This workshop contains 6 exercise blocks dedicated to various techniques on mocking different data types.
Boundaries
Understand what mocking really is, and learn how it helps you create test boundaries. See what each mock you introduce does to your tested code using visual metaphors.
Mocking Functions
Functions are at the heart of JavaScript logic. Learn how to mock functions for effective input-output testing. Create mock functions, spy on function calls, and mock function implementation to tap into the right behaviors of the tested code.
Mocking Date and Time
Eliminate the side effects of ever-changing date and time in your tests. Learn how to freeze time and mock date/time-dependent code to ensure consistent test results across different runs and time zones.
Mocking Globals
Explore how to mock implicit dependencies, in a non-intrusive way. Learn to mock global values, methods, and environment variables to create the perfect test setup without meddling with things you don't own.
Mocking Network
Gain control over network communication and test your client-side code reliably. Intercept requests and mock responses using Mock Service Worker. Reproduce various network scenarios, from success and error responses to offline behavior and response timing.
Mocking Modules
Understand when to use module mocking and explore alternative techniques before you do. Learn how to mock modules in a type-safe and efficient way using built-in APIs in Vitest.
Who This Workshop Is For
This workshop is meant for all developers, both those who are new to automated testing and those who've been writing tests for years. If you are unsure when to introduce mocks into your test suite, or how to do that so you don't have to refactor it the next day, this workshop was made specifically for you.
Homepage

Ukryta Zawartość

    Treść widoczna tylko dla użytkowników forum DarkSiders. Zaloguj się lub załóż darmowe konto na forum aby uzyskać dostęp bez limitów.

Screenshot








Ukryta Zawartość

    Treść widoczna tylko dla użytkowników forum DarkSiders. Zaloguj się lub załóż darmowe konto na forum aby uzyskać dostęp bez limitów.

No Password - Links are Interchangeable

Udostępnij tę odpowiedź


Odnośnik do odpowiedzi
Udostępnij na innych stronach

Dołącz do dyskusji

Możesz dodać zawartość już teraz a zarejestrować się później. Jeśli posiadasz już konto, zaloguj się aby dodać zawartość za jego pomocą.

Gość
Dodaj odpowiedź do tematu...

×   Wklejono zawartość z formatowaniem.   Usuń formatowanie

  Dozwolonych jest tylko 75 emoji.

×   Odnośnik został automatycznie osadzony.   Przywróć wyświetlanie jako odnośnik

×   Przywrócono poprzednią zawartość.   Wyczyść edytor

×   Nie możesz bezpośrednio wkleić grafiki. Dodaj lub załącz grafiki z adresu URL.


×
×
  • Dodaj nową pozycję...

Powiadomienie o plikach cookie

Korzystając z tej witryny, wyrażasz zgodę na nasze Warunki użytkowania.