inflearn logo

From Jest to Vitest, Introduction to JS Test Code

We may feel the need to write test codes, but when we actually start, the syntax and concepts feel so unfamiliar that it's hard to get into. Even when following examples, it's often confusing which matcher to use after `expect`, when mocks and spies are necessary, or how to verify asynchronous code. This course is designed for those new to JavaScript testing to step-by-step master the fundamentals of testing based on Jest, and then naturally transition to Vitest. Rather than simply saying "this is how you use it," we explain from a beginner's perspective why test functions should be separated, why export/import is necessary, and what values should be verified to create a good test. By following the course, students will progressively learn the basic structure of unit tests, how to use matchers, testing synchronous code, mocks and spies, and even asynchronous code and API mocking. Through this, you can build a foundation to verify behavior with test codes and refactor with confidence, instead of anxiously clicking through things manually every time you modify a feature.

25 learners are taking this course

Level Beginner

Course period Unlimited

Jest
Jest
vitest
vitest
unittest
unittest
msw
msw
Jest
Jest
vitest
vitest
unittest
unittest
msw
msw
No questions have been posted yet.
Post the first question and grow with Inflearn!

Free