Testing with Jest: From zero to hero

  Рет қаралды 62,937

LogRocket

LogRocket

Күн бұрын

Learn more about how to test your React apps with Jest.
Introduction - 00:00
Set up -- 01:07
Test example #1- 02:42
Mocking --10:18
Test example #2 - 26:27
Data matching - 29:02
Github repo: github.com/karlhadwen/jest-pl...
Try LogRocket for free: logrocket.com/?yt35
LogRocket is a frontend application monitoring solution that lets you replay problems as if they happened in your own browser. Instead of guessing why errors happen, or asking users for screenshots and log dumps, LogRocket lets you replay the session to quickly understand what went wrong. It works perfectly with any app, regardless of framework, and has plugins to log additional context from Redux, Vuex, and @ngrx/store.
In addition to logging Redux actions and state, LogRocket records console logs, JavaScript errors, stacktraces, network requests/responses with headers + bodies, browser metadata, and custom logs. It also instruments the DOM to record the HTML and CSS on the page, recreating pixel-perfect videos of even the most complex single-page apps.
Try it for free: logrocket.com/signup/

Пікірлер: 34
@niklasport5100
@niklasport5100 3 жыл бұрын
This was very informative. Wish there was a bit more use of these ideas on actual or hypothetical projects. A lot of it seemed to just be a little arbitrary, and not actually testing an App
@thomasb1205
@thomasb1205 3 жыл бұрын
Great tutorial, covered lots of concepts, thanks!
@antoniosousa2848
@antoniosousa2848 3 жыл бұрын
Great tutorial, that's really good for those who have never worked with tests before. Thanks!
@kylerebstock1487
@kylerebstock1487 3 жыл бұрын
This was great! The best there is on the topic! I can't see to find much else. I guess it's time to deepdive the docs. ;)
@theriddler525
@theriddler525 3 жыл бұрын
This is a great video. Thanks for putting this out there!
@paulthomas1052
@paulthomas1052 3 жыл бұрын
Great video. Concise and useful. Thanks.
@ghostpieces2362
@ghostpieces2362 Жыл бұрын
This is so simple to follow :), Please make more testing videos.
@afamsval
@afamsval 3 жыл бұрын
Thanks so much for this video. I really enjoyed it
@johngorman8020
@johngorman8020 Жыл бұрын
Really useful, a great starting point. Thanks!
@santoshnakka7431
@santoshnakka7431 2 жыл бұрын
Great session, thank you very much.
@wlancer8826
@wlancer8826 3 жыл бұрын
from zero to sidekick... I feel like a hero though thank you very muuuuuch!!
@barath89
@barath89 3 жыл бұрын
Thanks a lot. It's a great guide for the first-time learner like me.
@joemart6887
@joemart6887 2 ай бұрын
If on Typescript, you might get an error "Cannot find module './data.json'. Consider using '--resolveJsonModule' to import module with '.json' extension." The way that I fixed it was to add ""resolveJsonModule": true" to the 'tsconfig.json' under 'compilerOptions' and it worked.
@brahmadev7419
@brahmadev7419 3 жыл бұрын
Thanks for the great video... You provided super info in less time.... If possible can you show how do we handle the Filesystem mocks and any database mocs as well
@mocococo2877
@mocococo2877 2 жыл бұрын
Thank you for the time to put that good tutorial. There were so many examples. My complaints though will be Never used a real f-n to mock so I still can not make connection between what you showed and what should I do in case of real f-n. It all goes against a json file. Very heavy dialect, it was like you you do it intentionally or you do not care if we can follow.
@sleepcycle_
@sleepcycle_ 3 жыл бұрын
I'll be hero! 🔥
@jacksontriffon5064
@jacksontriffon5064 2 жыл бұрын
found there were quite a few things missing: - How to test a react component - How to test render() and probably lots more since this is only a basic intro.. after the video don't expect(to be able to test React components).toBe(true) just expect to understand that line and how to understand basic function testing
@sabermazoji466
@sabermazoji466 3 жыл бұрын
thank you very helpful for me
@ahmedpatel408
@ahmedpatel408 3 жыл бұрын
very good video
@nemoahmed
@nemoahmed 3 жыл бұрын
your awesome. thanks
@sdf0as9f0a9sda0s
@sdf0as9f0a9sda0s 3 жыл бұрын
from zero - means to teach how to do a basic setup and configuration.
@kresimircosic3753
@kresimircosic3753 3 жыл бұрын
Let's be real, this requires no setup. And if you're checking out testing, you're bound to know the basics of programming and setting up your workflow in some shape or form.
@xXxDerfoufixXx
@xXxDerfoufixXx 3 жыл бұрын
First person to be exited about an error
@kemalakcil
@kemalakcil 3 жыл бұрын
Nicest!
@aaron___6014
@aaron___6014 3 жыл бұрын
On a scale, 0 to 10....you started at like a 3 or more. What if you're using webpack?
@marcosyamgarcia6684
@marcosyamgarcia6684 3 жыл бұрын
You could have started by showing the script you ran you install jest..
@maikelm20
@maikelm20 3 жыл бұрын
What ide is this?
@bolorshagaienkhbold5722
@bolorshagaienkhbold5722 3 жыл бұрын
This is just test "json" file
@nope8605
@nope8605 3 жыл бұрын
i think just this so can't to be a hero for jest :(((
@lucadifazio2735
@lucadifazio2735 3 жыл бұрын
I am from Sicily and I wonder what Sicilian Pizza is 😂
@codercodercoder5977
@codercodercoder5977 2 жыл бұрын
how to test graphql calls on front end S:
@davedave9
@davedave9 3 жыл бұрын
Great viseo, but the way you pronounce “mock” is driving me crazy
@mania4k0
@mania4k0 3 жыл бұрын
While you are learning of how to become a "hero" in testing with Jest, it is very important to realize that every "for loop" you wrote so far is too basic, so you need to rewrite that [8:25], where "i++" should be "i += 1" instead!
How to Mock Fetch in Jest Manually
9:46
Leigh Halliday
Рет қаралды 38 М.
Redis Crash Course
27:31
Web Dev Simplified
Рет қаралды 592 М.
Pokey pokey 🤣🥰❤️ #demariki
00:26
Demariki
Рет қаралды 8 МЛН
The Worlds Most Powerfull Batteries !
00:48
Woody & Kleiny
Рет қаралды 19 МЛН
Designing scalable Compose APIs
19:53
Android Developers
Рет қаралды 10 М.
Stop Writing So Many Tests
10:02
Web Dev Simplified
Рет қаралды 79 М.
Test-Driven Development // Fun TDD Introduction with JavaScript
12:55
Generics: The most intimidating TypeScript feature
18:19
Matt Pocock
Рет қаралды 161 М.
Programming a Guessing Game in Rust!
13:22
Let's Get Rusty
Рет қаралды 103 М.
Python Lambda Functions??
4:30
b001
Рет қаралды 153 М.
Jest Crash Course - Learn How to Test your JavaScript Application
1:06:53
cool watercooled mobile phone radiator #tech #cooler #ytfeed
0:14
Stark Edition
Рет қаралды 7 МЛН
iphone fold ? #spongebob #spongebobsquarepants
0:15
Si pamer 😏
Рет қаралды 283 М.
МОЖНО ЛИ заряжать AirPods в чехле 🧐😱🧐 #airpods #applewatch #dyson
0:22
Apple_calls РЕПЛИКА №1 В РФ
Рет қаралды 21 М.
Теперь это его телефон
0:21
Хорошие Новости
Рет қаралды 1,7 МЛН
What model of phone do you have?
0:16
Hassyl Joon
Рет қаралды 63 М.