Jest Crash Course - Learn How to Test your JavaScript Application

  Рет қаралды 107,709

Laith Academy

Laith Academy

Күн бұрын

Пікірлер: 70
@ZTF666
@ZTF666 2 жыл бұрын
I swear i've been searching for jest crash courses for 30mins now ! and then i get the notification ... What a day !
@yaldakarimi3772
@yaldakarimi3772 2 жыл бұрын
love your channel, I've recently found you but your channel has everything I was looking for with great quality, thanks a lot
@shivakugan7712
@shivakugan7712 11 ай бұрын
Спасибо за новое видео. Уже давно слежу за вашим каналом, нашла много полезного для себя.
@soumyajitdey5720
@soumyajitdey5720 2 жыл бұрын
Exactly the crash course I wanted!! Thanks Laith.
@paschalynukwuani6930
@paschalynukwuani6930 Жыл бұрын
I just subscribed, because I never knew there was such a great teacher like you teaching JEST on KZfaq.
@stressed-ashen-cat
@stressed-ashen-cat 2 жыл бұрын
I have to say, you have the best quality tutorials out there!
@eliasvasques80
@eliasvasques80 Жыл бұрын
Terrific, the best tutorial I found on youtube about mocks.
@dawid_dahl
@dawid_dahl 2 жыл бұрын
Great course, thanks for including mocks and not just the simple pure function stuff.
@akinpelumi717
@akinpelumi717 Жыл бұрын
This channel is incredible, your teaching skill is great. Thank you, I appreciate what you're doing on this channel.
@user-on9th4lj3i
@user-on9th4lj3i 11 ай бұрын
Very cool, thanks! I am starting to learn jest. Your course has been very helpful!
@manangoyal5026
@manangoyal5026 Жыл бұрын
Beautiful video, crisp, to the point and nice explanation!
@user-cp4we7ic3n
@user-cp4we7ic3n 3 ай бұрын
Thanks for the quick and short crash course for Jest beginners!
@gmjitendra
@gmjitendra 2 жыл бұрын
Thank you so much. since long I was not able to get understanding of mocking which you explained practically in good way.. thanks and keep on.
@focusiam2027
@focusiam2027 Жыл бұрын
Such a nice tutorial, you're amazing. Thank you!❤❤❤
@maximus4510
@maximus4510 Жыл бұрын
Laith, you do deserve a 1M Subs for sure! Thanks for the content.
@jahelsantiago
@jahelsantiago 2 жыл бұрын
wow you create the video in one shot, that is amazing
@mnmsagar
@mnmsagar Жыл бұрын
Best Explanation Ever for Jest, Just Incredible
@gavincoulson3900
@gavincoulson3900 2 жыл бұрын
Great stuff, thanks for this!
@dirtycrumbs
@dirtycrumbs Жыл бұрын
Real nice tutorial L. Thanks for your hard work. 🙂
@coderjag8828
@coderjag8828 2 жыл бұрын
Very helpful video! Thank you!
@anarbairam
@anarbairam 3 ай бұрын
You didn't once fail to teach me any concept. Perfect teaching skills you have! Great explanation once again.
@hiteshsuthar1097
@hiteshsuthar1097 2 жыл бұрын
Thanks for providing Jest & React testing Library courses 🙏
@wahebbenzaid2591
@wahebbenzaid2591 2 жыл бұрын
Just a great channel , nothing to say else
@mayankkashyap79
@mayankkashyap79 Жыл бұрын
Nice course, very informative I have learned a lot. Thank You ❤️
@sagniksaha4179
@sagniksaha4179 8 ай бұрын
If anyone wants to clarify that why 3 === 3 is true and {} === {} is false, it is because in case of 3 === 3 is compared by value whereas objects are compared by hashcode(a location of the memory where the object exists). When you are comparing {} === {} then these are two different object at two different memory location which result in two different hashcode for comparison and thus return false. I hope I have done a good job in clarifying it 😅
@riteshkumarrai5349
@riteshkumarrai5349 6 ай бұрын
Yes
@SpiritMrKatarsis
@SpiritMrKatarsis 2 жыл бұрын
Nice! Especially thanks for mocking example with axios
@IslamicHarmonyChannel
@IslamicHarmonyChannel Ай бұрын
Came here from Net Ninja! New Subscriber!
@dthierno
@dthierno 2 жыл бұрын
You are the GOAT thanks a lot!
@vurrnurr
@vurrnurr Жыл бұрын
For anyone who struggled to understand how the mock.calls worked, as I did, too, initially - here is what [x] [y] mean: x represents the index of the call made (i.e. 0 = first call, 1 = second call, 2 = third call etc) and y represents the index of the first argument we find on that call (i.e. always 0 as we only have one argument). So, taking our example in the tutorial 'expect(mockCallback.mock.calls[1][0]).toBe(1)' - [1] represents the second call and [0] first argument, which in this case is 1. Hope this helps to clarify and keep up the good work studying! Thanks Laith Academy!
@hkhsm359
@hkhsm359 9 ай бұрын
Amazing video. Many thanks for mocking example with axios.
@abhishekranjan464
@abhishekranjan464 Жыл бұрын
I love your contest Laith! Been following your content when you had only few hundred subscribers : ) Do you have any plan to make web3 development tutorials in future?
@breezycodes
@breezycodes Жыл бұрын
Thanks. Wish you went more into mocking with classes and stuff.. but I get it now. ❤
@abhinavsingh-zc2hk
@abhinavsingh-zc2hk 2 жыл бұрын
Nice tutorial 👍
@nonsookongwu1556
@nonsookongwu1556 Жыл бұрын
great lecture... keep it up
@mahendranath2504
@mahendranath2504 2 жыл бұрын
Wow 👍🏼 beautiful. Amazing, I like your channel so much, 👍🏼❤️🎉🙏
@haroonafridi1802
@haroonafridi1802 2 жыл бұрын
cool thing. nice explanation
@thomasdevisser
@thomasdevisser Жыл бұрын
Thanks Laith, liked the course! Would've preferred a few less matcher methods and a bit more advanced info though, like using Jest with ES modules or testing React.
@abdurrehman661
@abdurrehman661 Жыл бұрын
Very good and helpful crash course👍👍👍
@rfryanfavour4369
@rfryanfavour4369 Жыл бұрын
Really nice
@kunalpandey7189
@kunalpandey7189 2 жыл бұрын
thank you for this
@_rachid
@_rachid 2 жыл бұрын
Thank you . The mocks part in the tutorial needs to be demystified more.
@veeravenkatagarapati2286
@veeravenkatagarapati2286 2 жыл бұрын
Laith, very good tutorial on Jest. Do you have any tutorial on JEST with LWC component to test field value on clicking submit button in the LWC.
@maazahmad4142
@maazahmad4142 2 жыл бұрын
Thanks Laith
@muhammadsalikin3886
@muhammadsalikin3886 Жыл бұрын
Thank you sir
@CRW3DMedia
@CRW3DMedia 2 жыл бұрын
Not sure if mentioned but I believe a mocked module/function must be included/required in the test code.
@andrewspatrick2452
@andrewspatrick2452 2 жыл бұрын
could you do a small project using context api + http requests? with your explanation it would be awesome!
@dinamohamed9985
@dinamohamed9985 Жыл бұрын
thank you
@rusliabdulgani9920
@rusliabdulgani9920 9 ай бұрын
for toBeCloseTo() assertion you can see the error not passed test, it show the limit (expected difference is 0.005)
@jerbparagas3924
@jerbparagas3924 5 ай бұрын
Have you mock a prisma client before? I have trouble using it in my test, the mockResolvedValue I given to first test file is working, but the data i put there exists to the next test file. I have clearMock or resetMock but it is not working, :(. maybe can you do a video mocking prisma?
@utshosadhakjoy6702
@utshosadhakjoy6702 2 жыл бұрын
can i install jest globally in my laptop ?
@filippetkovski9957
@filippetkovski9957 2 жыл бұрын
Please a video for testing next.js with typescript
@paxdriver
@paxdriver Жыл бұрын
I see you're a fan of Traversy Media lol gotta practise that Boston accent to really stick the landing 😜
@-Sreekanth
@-Sreekanth Жыл бұрын
Can you please tell me how to write unit test for a button click..
@devman6552
@devman6552 2 жыл бұрын
Are you Brad? :)
@owltrades
@owltrades 2 жыл бұрын
Nice course but I didn't get mocks
@DeepakGupta-hj2dv
@DeepakGupta-hj2dv 2 жыл бұрын
please make on video React unit testing crash course
@laithacademy
@laithacademy 2 жыл бұрын
I have one on my channel: kzfaq.info/get/bejne/fbKDhrWl07S9YJs.html and on Net Ninja channel: kzfaq.info/get/bejne/bcqEh6mInN-lc4U.html
@youcefmantas4944
@youcefmantas4944 Жыл бұрын
the course is really cool but the mocks part needed more explination and clarification
@kaleemahmed3300
@kaleemahmed3300 2 жыл бұрын
Can we get react crash course for beginners plz
@_rachid
@_rachid 2 жыл бұрын
You can find this on Brad Schiff's LearnWebCode youtube channel. He is a good instructor too.
@kirarevcrow
@kirarevcrow 2 жыл бұрын
It's a bad practice and something to avoid when testing real endpoints. You should have a mock data, preferably using MSW package to mock your endpoints. Never test real endpoints.
@WarrenBey
@WarrenBey Жыл бұрын
Why is everyone on KZfaq trying to teach the most basic elementary level shit? Meanwhile every job in the real world has 10+ years of code all piled into 1,000+ line long react components that use every known library to man, a giant clusterfuck of class based and functional based components, hundreds of thousands of objects stored in Redux, an entire other section of the UI using Angular 2, one small UI element in Vue.js, a whole other UI in Ember.js that has been deprecated, a holiday/promotional section using Knockout and jQuery and 3 working tests with 145 skipped tests. And were supposed to take his 1+2=3 test experiment into the real world?
@BTypeGuy
@BTypeGuy Жыл бұрын
I feel you. Know any videos/courses better than this?
@kantorobo7718
@kantorobo7718 Жыл бұрын
around 58:49 if you don't understand this, console.log it. and add some values to forEach(['zero', 1, 'spread'], mockCalledBack); for clarity. For Example: console.log(mockCalledBack.mock.calls[0][0]) will return zero so it returns the string zero forEach(['zero', 1, 'spread'], mockCalledBack); If you run it again with console.log(mockCalledBack.mock.calls[0]) it will return [ ' zero ' ] a array with 1 element a string 'zero' So with the first notation you get the element inside the array. With the second notation you get a array with the element at your chosen index. For example: console.log(mockCalledBack.mock.calls[2][0]) returns a string spread console.log(mockCalledBack.mock.calls[2]) returns a array with 1 element at index 2 of the original array. so [ ' spread ' ] There for changing the second number to higher then 0 will return undefined because the array length is 1. And you access that first and only element with calls[indexOriginalArray][0] console.log(mockCalledBack.mock.calls[2][1]) returns undefined Testing: expect(mockCalledBack.mock.calls[2][0]).toMatch('spread'); Will pass because console.log(mockCalledBack.mock.calls[2][0]) returns a string spread Keep supporting channels like this, it makes all of us a better dev :)
@WantOxide
@WantOxide Жыл бұрын
There is an error on the jest home page at the beginning: it says: "Jest is a delightful javascript testing framework". It should be "Jest is shit and a nightmare".
@laithacademy
@laithacademy Жыл бұрын
build a better testing framework then
@ShaunMcCready
@ShaunMcCready 2 жыл бұрын
Great tutorial on Jest!! A lot of this stuff I learnt on my own but over a much longer period. I came here because im having an issue with a spy and a mockImplementationOne() call. It just isn't replacing the implementation with the one being passed... no idea why.
JavaScript Testing Basics with Jest
54:03
Swashbuckling with Code
Рет қаралды 27 М.
Me: Don't cross there's cars coming
00:16
LOL
Рет қаралды 15 МЛН
I wish I could change THIS fast! 🤣
00:33
America's Got Talent
Рет қаралды 125 МЛН
Khó thế mà cũng làm được || How did the police do that? #shorts
01:00
React Testing Library Crash Course
2:26:49
Laith Academy
Рет қаралды 47 М.
Testing with Jest: From zero to hero
36:56
LogRocket
Рет қаралды 63 М.
The Docker Crash Course
2:23:09
Laith Academy
Рет қаралды 17 М.
Testing In React Tutorial - Jest and React Testing Library
21:28
Mocking Asynchronous Functions with Jest
21:50
Swashbuckling with Code
Рет қаралды 67 М.
Jest. Unit Тестирование в JavaScript
1:27:05
Владилен Минин
Рет қаралды 168 М.
Test-Driven Development // Fun TDD Introduction with JavaScript
12:55