Skip to content
Daily Hangul
Daily Hangul Study Desk
SHIBA

TOPIK 5 Curriculum · 3,036 Lessons

TOPIK 5 (Advanced)

CEFR C1 (Advanced) Korean lessons in English. Express complex opinions on Korean news, technology, economics, corporate strategy, and academic debates with native-level fluency.

$rac{ * * * * extbf{ The * 200 ‘ * * * ` We must start creating other things too now, like what components we want and write tests. So, for component, state and testing purpose we must need to install React Testing Library i.e. `jest` and `@testing-library/react`. 💡 To implement it, type `npm i -D vitest vitest-environment-jsdom @testing-library/react @testing-library/jest-dom @testing-library/user-event jsdom @vitejs/plugin-react` inside our react terminal. Great, now we can proceed with other file settings. Go and configure `vite.config.js` like below. Here, we add `test` property to tell vite is ready to of use of `vitest` other than the default. Also, to have JSX and typescript working in `test` we are using `@vitejs/plugin-react` . Next we need to create `setupTests.ts` where we can state global configuration and imports of `@testing-library/jest-dom` for testing. After setting up, we'll write `package.json` with a script to easily run jest tests (`npm run test`). The testing library we of course is standard and standard. Let's make sure things work and move ahead with the test suite with some basic tests. Let's start with testing state of `App.tsx` and see how they are state changed upon the click. Then, we are going to write test-cases for: * `ProductCard` (clicking on add to cart, correct items added or not) * `Cart` (checkout button being disabled when there are no items to buy, items in cart correctly shown, item total is calculated properly) * `CartItem` (on increase clicked, on decrease clicked, on remove from cart, etc) * `Navigation` (showing - Daily Hangul TOPIK 5
TOPIK 5 · 8 min read

$ rac{ * * \ * * extbf{ The * 200 ‘ * * * ` We must start creating other things too now, like what components we want and write tests. So, for component, state and testing purpose we must need to install React Testing Library i.e. `jest` and `@testing-library/react`. 💡 To implement it, type `npm i -D vitest vitest-environment-jsdom @testing-library/react @testing-library/jest-dom @testing-library/user-event jsdom @vitejs/plugin-react` inside our react terminal. Great, now we can proceed with other file settings. Go and configure `vite.config.js` like below. Here, we add `test` property to tell vite is ready to of use of `vitest` other than the default. Also, to have JSX and typescript working in `test` we are using `@vitejs/plugin-react` . Next we need to create `setupTests.ts` where we can state global configuration and imports of `@testing-library/jest-dom` for testing. After setting up, we’ll write `package.json` with a script to easily run jest tests (`npm run test`). The testing library we of course is standard and standard. Let’s make sure things work and move ahead with the test suite with some basic tests. Let’s start with testing state of `App.tsx` and see how they are state changed upon the click. Then, we are going to write test-cases for: * `ProductCard` (clicking on add to cart, correct items added or not) * `Cart` (checkout button being disabled when there are no items to buy, items in cart correctly shown, item total is calculated properly) * `CartItem` (on increase clicked, on decrease clicked, on remove from cart, etc) * `Navigation` (showing

Conquer Veranda Pests Like a K-Drama Pro: The Advanced Guide to Eco-Friendly Plant Heali…

SHIBA

Most Read Lessons

Popular · Top 3