Testing with Jest: From zero to hero

  Рет қаралды 63,086

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
@antoniosousa2848
@antoniosousa2848 3 жыл бұрын
Great tutorial, that's really good for those who have never worked with tests before. Thanks!
@thomasb1205
@thomasb1205 3 жыл бұрын
Great tutorial, covered lots of concepts, 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. ;)
@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
@theriddler525
@theriddler525 3 жыл бұрын
This is a great video. Thanks for putting this out there!
@paulthomas1052
@paulthomas1052 3 жыл бұрын
Great video. Concise and useful. Thanks.
@barath89
@barath89 3 жыл бұрын
Thanks a lot. It's a great guide for the first-time learner like me.
@johngorman8020
@johngorman8020 2 жыл бұрын
Really useful, a great starting point. Thanks!
@afamsval
@afamsval 3 жыл бұрын
Thanks so much for this video. I really enjoyed it
@santoshnakka7431
@santoshnakka7431 2 жыл бұрын
Great session, thank you very much.
@ghostpieces2362
@ghostpieces2362 Жыл бұрын
This is so simple to follow :), Please make more testing videos.
@wlancer8826
@wlancer8826 3 жыл бұрын
from zero to sidekick... I feel like a hero though thank you very muuuuuch!!
@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
@sleepcycle_
@sleepcycle_ 3 жыл бұрын
I'll be hero! 🔥
@sabermazoji466
@sabermazoji466 3 жыл бұрын
thank you very helpful for me
@nemoahmed
@nemoahmed 3 жыл бұрын
your awesome. thanks
@ahmedpatel408
@ahmedpatel408 3 жыл бұрын
very good video
@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.
@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.
@joemart6887
@joemart6887 3 ай бұрын
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.
@xXxDerfoufixXx
@xXxDerfoufixXx 4 жыл бұрын
First person to be exited about an error
@kemalakcil
@kemalakcil 3 жыл бұрын
Nicest!
@jacksontriffon5064
@jacksontriffon5064 3 жыл бұрын
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
@marcosyamgarcia6684
@marcosyamgarcia6684 4 жыл бұрын
You could have started by showing the script you ran you install jest..
@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?
@maikelm20
@maikelm20 3 жыл бұрын
What ide is this?
@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 😂
@bolorshagaienkhbold5722
@bolorshagaienkhbold5722 3 жыл бұрын
This is just test "json" file
@codercodercoder5977
@codercodercoder5977 3 жыл бұрын
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!
Mocking Asynchronous Functions with Jest
21:50
Swashbuckling with Code
Рет қаралды 67 М.
Jest. Unit Тестирование в JavaScript
1:27:05
Владилен Минин
Рет қаралды 168 М.
Каха и суп
00:39
К-Media
Рет қаралды 4,3 МЛН
路飞被小孩吓到了#海贼王#路飞
00:41
路飞与唐舞桐
Рет қаралды 67 МЛН
Mock vs Spy in Testing with Jest: Which is Better?
25:12
Dev tips by MoHo
Рет қаралды 9 М.
React Testing Library Crash Course
1:16:52
Laith Academy
Рет қаралды 89 М.
Jest Crash Course - Learn How to Test your JavaScript Application
1:06:53
Mocking Axios in Jest + Testing Async Functions
17:43
Leigh Halliday
Рет қаралды 83 М.
JavaScript Testing - Mocking Async Code
18:05
Academind
Рет қаралды 144 М.
Testing Express REST API With Jest & Supertest
55:46
TomDoesTech
Рет қаралды 116 М.
Самый дорогой кабель Apple
0:37
Romancev768
Рет қаралды 339 М.
YOTAPHONE 2 - СПУСТЯ 10 ЛЕТ
15:13
ЗЕ МАККЕРС
Рет қаралды 188 М.
iPhone 16 с инновационным аккумулятором
0:45
ÉЖИ АКСЁНОВ
Рет қаралды 8 МЛН
Todos os modelos de smartphone
0:20
Spider Slack
Рет қаралды 660 М.