What Is Vitest? - What is Web Development?

  Рет қаралды 11,455

Syntax

Syntax

Күн бұрын

Becomes a Level Up Pro
leveluptutoria...
vitest.dev
/ 1468233216939245579

Пікірлер: 18
@stasoline
@stasoline 2 жыл бұрын
Nice overview! Regarding snapshot tests: They're kind of a middle ground between a unit and integration test. You render your component (kind of like an integration test with Puppeteer or similar) and once you've made changes you as a dev can easily see what real world DOM changes your code change corresponds to. I call it a "poor man's integration test" because it's much easier to set up than an actual integration test.
@fpigeonjr
@fpigeonjr 2 жыл бұрын
🧡Vitest is here to save the day. Would love to see a course on LUTs covering this.
@alexgochenour8740
@alexgochenour8740 2 жыл бұрын
Great video as always, Scott. Been using Jest for a while and it's been feeling a bit ill-suited for modernJS projects. So glad I found this.
@shawnlee6775
@shawnlee6775 2 жыл бұрын
Been using it since 0.2 and it does wonders. A gift from the lord!
@tziortziskyprianou2725
@tziortziskyprianou2725 2 жыл бұрын
Hey Scott, do you thing is now “safe” to use on production? We will start writing unit tests for a new project, based on your experience with vitest, would you recommend it!? Does it also works fine with react testing library?
@IainSimmons
@IainSimmons 2 жыл бұрын
The docs have some examples using RTL: vitest.dev/guide/#examples As for it being safe, the site used to warn that it wasn't ready for production, but that seems to be gone now. It seems to already do pretty much everything you'd expect or need from a regular Jest setup, so I'd recommend you try it and if you hit a point where it doesn't, it should be trivial to switch back to Jest since the APIs are almost the same.
@stasoline
@stasoline 2 жыл бұрын
Anthony's cat is the main contributor to Vitest.
2 жыл бұрын
Nice one, going to do some test on a sveltekit project
@AmxCsifier
@AmxCsifier 2 жыл бұрын
I use it for tdd, great tool
@arnolddevmode9603
@arnolddevmode9603 2 жыл бұрын
is there like a reason that people still use jest snapshot
@syntaxfm
@syntaxfm 2 жыл бұрын
It's fast and easy.
@IainSimmons
@IainSimmons 2 жыл бұрын
It helps to quickly find regression issues, especially if you have multiple people working on a project. One person might change a component, then run the tests and have a snapshot test fail because it affected the output of another component that uses the one that changed. Now they know to check that one and make sure it's still okay. If it is, it's pretty trivial to run the test again and update the snapshot at the same time, and commit the updated snapshots with the updated tests so it all passes in the CI/CD too.
@Wzymedia
@Wzymedia 2 жыл бұрын
That Rust-like inline testing thing is more than a bit "if-y"...
@syntaxfm
@syntaxfm 2 жыл бұрын
Why do you say that?
@Wzymedia
@Wzymedia 2 жыл бұрын
​@@syntaxfm It's doubling up on the LoC for what boils down to be commentary on how your code is supposed to work. Also, what about "Separation of Concerns" and "SOLID principles" and all that?
@syntaxfm
@syntaxfm 2 жыл бұрын
@@Wzymedia The Vitest docs + Vite show you how you can use dead code elimination to remove the test code from your bundle, so having the extra lines isn't a concern here, but I do know that some people love having separated concerns. That said, colocating things has become more common in the modern component based world. To me that's not a major concern and is something I've grown fond of in Rust.
@Wzymedia
@Wzymedia 2 жыл бұрын
@@syntaxfm With what I said in mind, I am someone who loves commenting code. I will have more comments than code and that feels natural to me. In fact, at times I think some code looks "naked" without comments... yet I find this inline tests thing weird.
@hiagooliveira6510
@hiagooliveira6510 2 жыл бұрын
​@@Wzymedia sorry to barge in the conversation, but your stance regarding comments is what I find "if-y". Good, clean code barely needs any comments, because you can read that code like text, (or like prose, as Uncle Bob would say). If you give appropriate names to your functions, variables, use explanatory variables, etc, you will barely need comments. My code barely has comments because of this. If your functions are so convoluted that they need tons of comments, you should break them up, make them simpler, etc.
Why Vitest Is Better Than Jest
13:13
Web Dev Simplified
Рет қаралды 134 М.
What Is the Temporal API - What Is Web Development?
6:53
Dad gives best memory keeper
01:00
Justin Flom
Рет қаралды 21 МЛН
1ОШБ Да Вінчі навчання
00:14
AIRSOFT BALAN
Рет қаралды 6 МЛН
UI Libraries Are Dying, Here's Why
13:28
Theo - t3․gg
Рет қаралды 310 М.
Test-Driven Development // Fun TDD Introduction with JavaScript
12:55
What Is ViteJS?
8:32
Syntax
Рет қаралды 32 М.
The ONLY REASON To Unit Test
8:26
Theo - t3․gg
Рет қаралды 78 М.
TDD in JavaScript | Test Driven Development
13:20
Sam Meech-Ward
Рет қаралды 12 М.
SvelteKit is my mistress
4:19
Fireship
Рет қаралды 421 М.
Switching From Jest To Vitest - Should You Take The Step?
6:39
JS 2 brain
Рет қаралды 2,6 М.
The Most Legendary Programmers Of All Time
11:49
Aaron Jack
Рет қаралды 558 М.
Dad gives best memory keeper
01:00
Justin Flom
Рет қаралды 21 МЛН