Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
Now that's it for this module,
which is only an introduction to testing
or to testing React apps.
Now, testing as I mentioned at the beginning
is definitely a topic an entire course could be created on.
But this course is not about that.
It's about React and therefore I want
to introduce you to React testing.
I don't want to include an entire testing course
into this course as well.
Now, if you want to learn more about testing,
of course there are dedicated tutorials and courses
you can check out.
But what's also definitely worth a look,
are the official docs of Jest.
This tool we used under the hood
for running our tests and for asserting the results
and the docs of the React testing library.
Now let's start with Jest.
If you Google for Jest you find these official docs
and these docs aren't too bad.
Now, keep in mind that all these setup steps here
are not required by you because in our React project
you already have a setup.
And also keep in mind here,
that Jest is not a tool focused on just React.
It's a general JavaScript testing tool,
and therefore the docs represent that.
But still here, you can learn more
about the different matchers, which you have,
the different ways of expressing expectations.
You can learn more about testing async code.
How you can wait for promises to complete, if you want that.
You can learn more about mocking functions,
something we also did in this module.
Here you can dive deeper and learn more
about the possibilities you've got there,
for mocking regular functions.
And also of course, for mocking promises,
as we did it here as well.
You can learn more here and in general.
Check out these different guides here to learn
about the different examples and the different features
this tool has to offer.
Now, when it comes to testing React
you want to check out the React Testing Library docs.
These docs are also great, and in there you learn way more
about testing React with that library.
You also find a complete example here,
which could be interesting to check out.
You find the complete API, which you have available.
Also check out the core API here to learn
about these different query methods.
GetBy, findBy, queryBy.
You also get the differences explained here again.
You also learn more about firing user events here.
You'll learn more about async code here,
and therefore that definitely also is a documentation
that is worth a closer look if you are serious
about testing React apps.
I especially also want to highlight the ecosystem part here.
Where you learn about extensions, that you can install.
Some of these extensions already are part
of a default project set up in a React app.
For example, the user-event extension.
But I especially also want to highlight one extension,
which is not listed here.
And that is the React-hooks-testing-library extension,
which makes testing React hooks especially custom hooks,
way easier.
Here you can learn how to use that extension
in case you have custom book functions,
which you want to test.
Which of course, typically do want to test
because you should test your entire code base if possible.
And therefore these are resources you can dive
in as a next step, but I hope
that this course module gets you started with testing
and you now at least have a general idea
of how that all works.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.