React unit testing with Jest & React-testing-library

preview_player
Показать описание
Complete Guide to Component testing with Jest for beginners. Crash course on Jest and mocking

#react #jest #testing

*My Udemy Courses

Follow me for technology updates

Help me translate this video.
Рекомендации по теме
Комментарии
Автор

You crushed my heart when you made a button component but then used a div instead of a button element 😭

cory
Автор

This is a very good tutorial that helped me better understand front end unit testing for React. I found it hard to follow the documentation, especially when there are 3 or 4 testing libraries that are being used without specific reference to each library

fonosayno
Автор

One of the best tutor that available on YouTube. Hit like if you learned ReactJs under the hood by watching his videos

joemadhan
Автор

it looks like the cleanup is now something that happens by default. Which is pretty awesome.

idumiclovich
Автор

You are saving my quarantined days, I'm hooked up to your channel. TY for your tutorials.

arsfreelance
Автор

01:16 Installations
02:12 Create component for testing
06:53 Testing

clasesutnfrc
Автор

I love people who actually explain what they are doing instead of narrating what they are typing.  🥰 Thank you!

lumbimbi
Автор

We can also write snapshots as
it('matches snapshot', () => {

const { asFragment } = render(<Button label='hi' />)




})

reactivicky
Автор

can we see something useful like dealing with changes to state, props, using fireEvent, etc, etc?

compeng
Автор

Great Video!, one thing I wanted to say is :
"Adding data-test-id just for testing is not digestible, because here we are increasing DOM property which is not being used in feature development".

SudhanshuRamTripathi
Автор

Thank you so much men. You bearly saved me for the Technical Interview 🤠

teodortodorov
Автор

You make everything look so simple. Great job

RajeshSamson
Автор

Excellent video. Waiting for a fullstack Udemy course from you! You should def show us how to implement more testing / testing best practices if you ever create create the course

cleo
Автор

please make a tutorial on testing Redux with React using JEST and RTL

gottedev
Автор

I believe that now it should be: npm install @testing-library/react @testing-library/jest-dom react-test-renderer --save-dev
And eventually before: npm uninstall jest-dom

Nicosprintos
Автор

Great tutorial, just a little tip for anyone working React v.16^:

Instead of importing the extend-expect from the jest-dom you just need to type the following:

// 123');
^^ the above snippet is outdated use the line below to pass the test.

123');

It took me longer than what I would like to admit to find the solution.

skyenolimit
Автор

The video is very concise and to the point.

berakoc
Автор

seems like cleanup is not needed anymore with Jest ?

OZENKAWA
Автор

16:32 what do you mean "they run out of the names"? You defined this name. By this kind of import you can use whatever name you want

TheMurtukov
Автор

Sirji yeto chote chote test cases hue but let's say I have 500 line of code with huge business logic then how could I test that component again what is use of this test case I really don't know could you please explain?

mybaby