A Community Resource means that it’s free to access for all. The instructor of this lesson requested it to be open to the public.
Instructor: Hey, folks. This module is a little bit unique because I don't necessarily recommend that you do all of the things specifically that I'm going to show you. I mostly just want to show you that it is totally possible to use DOM testing library with anything that renders to the DOM. Let's take a look at this project really quick.
Here we've got a bunch of different files. We have this from HTML. I bet you didn't even know that this was a library, but it does exist and it's just a thing that takes HTML, turned it into DOM. It has a component kind of API, which is interesting. We've got Mithril and Knockout and jQuery, Hyperapp, a whole bunch.
We also have a Svelte counter, which is an interesting and unique one. We're going back to Angular JS here. Of course, we do have React and so we can take a look at how you do React without React testing library and Jest with DOM testing library.
We also have Vue in here, but there's already actually a Vue testing library. There's an Angular testing library, there's a Svelte testing library, a Preact testing library.
They're already implementations of testing libraries specific to each one these frameworks, but it's a good idea for you to understand how these things work under the hood. That's why we're going to show you this directly without using those abstractions.
Each one of these is slightly unique, but the thing that I like most about this is that most of the test after you get pass that first render right here are going to be the exact same. They all just get the counter, they click on the counter, they verify that the counter is incremented, they click on it again and verifies it increments again.
That's one of the things that I love so much about the testing library family of tools. You can learn React testing library and then jump into a Vue project and you can start testing with the Vue testing library there.
That's just one of the things that falls out of the beautiful pattern of separating ourselves from implementation details. We don't have to worry about what the implementation for getting stuff onto the page is. Our testing library can handle all of that.
I'm really excited for you to check some of this out. It's quite fascinating. Let's go ahead and jump in.