How to use TDD to refactor a web front that consumes a REST service

  Рет қаралды 4,041

Dev Mastery

Dev Mastery

Күн бұрын

Пікірлер: 10
@JuniorMoreiraC
@JuniorMoreiraC 5 жыл бұрын
This is gold! As my teacher used to say, ‘pay attention because you won’t find this talk in a pub!’ :)
@thong.nguyen17
@thong.nguyen17 2 жыл бұрын
This is absolutely hidden gem!
@DevMastery
@DevMastery 5 жыл бұрын
If you like this video, you'll love my newsletter. www.devmastery.com What else would you like to see on this channel? Leave a comment below.
@enzoferey
@enzoferey 5 жыл бұрын
Thank you, very instructive as per usual ! Keep up the nice content :)
@JamieNeubertPedersen
@JamieNeubertPedersen 5 жыл бұрын
Thank you for the video. If you had multiple functions calling the API (e.g. findMovies, findPosters, findRatings) would you then move the axios dependency out into a different function so you don't have to use it explicitly in every function?
@DevMastery
@DevMastery 5 жыл бұрын
No. But I understand where you're coming from. At the heart of your question is the desire to isolate things that are likely to change from things that are expensive to change. But because axios is extremely popular, widely used, well supported, and based largely on the HTTP spec, it's less likely to change in ways that break my app. Furthermore, because I have isolated my query and normalization logic such that they have no dependancy on axios, the cost of mitigating a breaking change is fairly low. I can easily create an adaptor and search/replace "import axios from 'axios'" to "import axios from './my-axios-adaptor' and I have a test suite at my back that will tell me if my new adaptor broke anything. So, writing and using such an adaptor ahead of time, is probably not worth the effort in this particular case.
@Tejas-zx7ie
@Tejas-zx7ie 4 жыл бұрын
5:50 I don't understand why you don't recommend using mock. Though we set the mock responses, we are still testing the functionality that we wrote. Mock just intercept and instead of sending req to actual API, it uses its own function that we define. I don't understand how using mock is any different than doing what you did. Ultimately, we are using dummy data to test + using mock from Jest has some advantage of having more additional tests on the test itself with ".toHavBeen.." functions. Could you please explain if I am missing something?
@jacsurfing
@jacsurfing 5 жыл бұрын
i have to wait until Monday to see your update. come on, man. update twice a week or more. i just can't wait
@igor_cojocaru
@igor_cojocaru 5 жыл бұрын
Thank you!
@abiakhil69
@abiakhil69 4 жыл бұрын
Thank you sir
How to add a "Dark Mode" to your React website.
12:27
Dev Mastery
Рет қаралды 19 М.
Мама у нас строгая
00:20
VAVAN
Рет қаралды 4,9 МЛН
PRANK😂 rate Mark’s kick 1-10 🤕
00:14
Diana Belitskay
Рет қаралды 11 МЛН
Real Man relocate to Remote Controlled Car 👨🏻➡️🚙🕹️ #builderc
00:24
Test-Driven Development // Fun TDD Introduction with JavaScript
12:55
Refactoring JavaScript with pipeline style programming
24:17
Dev Mastery
Рет қаралды 14 М.
Event-Driven Architecture (EDA) vs Request/Response (RR)
12:00
Confluent
Рет қаралды 169 М.
🚀  TDD, Where Did It All Go Wrong (Ian Cooper)
1:03:55
DevTernity Conference
Рет қаралды 567 М.
Introduction To Vert.x: Asynchronous Coordination
17:50
Deven Phillips
Рет қаралды 9 М.
The Ultimate Coding Workflow
20:26
Dev Mastery
Рет қаралды 18 М.
Freedom from front end frameworks (React, Vue, etc...)
20:38
Dev Mastery
Рет қаралды 12 М.
Deep Dive into REST API Design and Implementation Best Practices
12:02
Software Developer Diaries
Рет қаралды 60 М.
Мама у нас строгая
00:20
VAVAN
Рет қаралды 4,9 МЛН