Shipping React app with zero-bugs policy using TDD (Nik Sumeiko)

  Рет қаралды 5,484

Tech Excellence

Tech Excellence

Күн бұрын

Пікірлер: 22
@TechExcellence
@TechExcellence Жыл бұрын
Here's a link to the repository of the demo project: github.com/niksumeiko/iban-validator-react-tdd-kata
@jcupac
@jcupac Жыл бұрын
Very practical code demo that simplifies TDD implementation
@TechExcellence
@TechExcellence Жыл бұрын
Thank you!
@thatkidplongy
@thatkidplongy Жыл бұрын
More of this type of content please, very helpful!
@TechExcellence
@TechExcellence Жыл бұрын
Thanks for your feedback, what did you find most helpful in the video?
@aleksamitic6655
@aleksamitic6655 11 ай бұрын
Amazing stuff! Deff going to try this practice.
@TechExcellence
@TechExcellence 11 ай бұрын
Thank you @aleksamitic6655for your feedback :)
@marlonsaviandev
@marlonsaviandev Жыл бұрын
Awesome content
@TechExcellence
@TechExcellence Жыл бұрын
Thank you, we appreciate your feedback!
@vladanulardzic3186
@vladanulardzic3186 Жыл бұрын
Thank you TE and Nik Sumeiko . GREAT job, really. Practice with theory backup. Explained in details - STEP BY STEP. Covered all by somebody who works in bank. If possibly - keep on with other projects.
@TechExcellence
@TechExcellence Жыл бұрын
You're welcome Vladan!
@sepehrsafarii
@sepehrsafarii Жыл бұрын
Awesome! Thanks for the content.
@TechExcellence
@TechExcellence Жыл бұрын
You're welcome, glad that you enjoyed it!
@nicolasdiot7007
@nicolasdiot7007 Жыл бұрын
Hi, what is the name of the app you used to run your e2e test and have a live demo (at 36:06 on the video) ? And thank you a lot for this code demo, it really simplifies TDD implementation ! 😊
@niksumeiko
@niksumeiko Жыл бұрын
We use Cypress for both E2E and integration tests.
@nicolasdiot7007
@nicolasdiot7007 Жыл бұрын
Thank you
@PaulSebastianM
@PaulSebastianM 6 ай бұрын
23:44 I find the IBAN validation API adapter a bit too complicated. You shouldn't need a closure to cache the IBAN to be validated. You could just create an Adapter class or object that would contain IBAN related functions like validating an IBAN, extracting encoded information from that IBAN and so on. This would mean less mallocs to just validate an IBAN. Just have a singleton adapter and functions you can directly call on it, like `validateIBAN(iban: string)`.
@niksumeiko
@niksumeiko 6 ай бұрын
The closure leaves an opportunity to pass an argument when the adapter is for mutations: // Adapter factory function createAdapter(options) { ‎ ‎ return (x) => { ‎ ‎ ‎ ‎ // do communicate with an outside world ‎ ‎ }; } // Use Case const useCreateTodo = () => { ‎ ‎ const factory = useAdapterFactory(); ‎ ‎ const mutation = useMutation({ mutationFn: factory() }); ‎ ‎ const [formValues, setFormValues] = useState(); ‎ ‎ const handleSubmit = () => { ‎ ‎ ‎ ‎ const result = await mutation.mutate(formValues); ‎ ‎ }; };
@niksumeiko
@niksumeiko 6 ай бұрын
Plus, the closure allows passing the request (a method that communicates to the outside world). This makes it easy to write a unit test for such an adapter because a fake request can be provided.
@PaulSebastianM
@PaulSebastianM 6 ай бұрын
I hope you end up using Mock Service Worker instead of mocking window.fetch... will have to watch to the end and see, because I don't like having to dirty the API adapter by injecting what is basically an http client. It might make sense in C# but in JS world you have things like window.fetch or axios and their interfaces are not compatible, unless you abstract them yourself and create a common interface.
@niksumeiko
@niksumeiko 6 ай бұрын
If we mock the request (a method that communicates to the outside world) using MSW, the test will run a bit slower than if we pass a fake implementation of the request. Doing MSW in the integration tests - where we assert user journeys by rendering specific parts of the app - totally makes sense. However, asserting all the implementation details of the adapter (e.g., headers that are passed into the request) by involving MSW in the unit test is inefficient, nor it's efficient to assert these implementation details in integration tests. A better approach is to have a trivial unit test doing this job.
Balancing Coupling in Software Design (Vlad Khononov)
1:31:19
Tech Excellence
Рет қаралды 2,5 М.
Unit Testing Is The BARE MINIMUM
20:33
Continuous Delivery
Рет қаралды 32 М.
Car Bubble vs Lamborghini
00:33
Stokes Twins
Рет қаралды 40 МЛН
Wait… Maxim, did you just eat 8 BURGERS?!🍔😳| Free Fire Official
00:13
Garena Free Fire Global
Рет қаралды 9 МЛН
Motorbike Smashes Into Porsche! 😱
00:15
Caters Clips
Рет қаралды 23 МЛН
🚀  TDD, Where Did It All Go Wrong (Ian Cooper)
1:03:55
DevTernity Conference
Рет қаралды 566 М.
By the Bye: JNI | Birgit Kratz
26:25
XtremeJ Conference
Рет қаралды 10
The Most Important Design Pattern in React
35:04
Cosden Solutions
Рет қаралды 99 М.
Test-Driven Development in JS with Acceptance Tests
53:08
Bran van der Meer
Рет қаралды 2,1 М.
Nik Sumeiko: React with Test-driven development
2:54:24
Our Tech Journey
Рет қаралды 863
Introduction to Test Driven Development with React
20:38
Coding With Adam
Рет қаралды 20 М.
Angular Testing Strategies
44:36
Angular Macedonia
Рет қаралды 20
Thoughts About Unit Testing | Prime Reacts
11:21
ThePrimeTime
Рет қаралды 231 М.
Car Bubble vs Lamborghini
00:33
Stokes Twins
Рет қаралды 40 МЛН