Հարակից թեմաներ
Դասընթացը ներառում է
- 53 ր տեսանյութ
- 5 դաս
- Մակարդակ՝ Սկսնակ
- Լեզուն՝ English
- Հիշում ենք, որտեղ կանգ առար
- Ամբողջովին անվճար, առանց քարտի
Դասեր
1 բաժին · 5 դաս · 53 ր ընդհանուր տևողությունը
Դասեր 1–55 դաս · 53 ր
- Node.js Native Test Runner Tutorial 5 - Hooks (before, after, beforeEach, afterEach) Setup/Teardown11 ր
- Node.js Native Test Runner Tutorial 4 - Test Asynchronous Code (Callbacks, Promises, Async/Await)11 ր
- Node.js Native Test Runner Tutorial 3 - How To Organize Tests, Test Suites, and Subtests15 ր
- Node.js Native Test Runner Tutorial 2 - How To Use Assertions and Handle Errors11 ր
- Node.js Native Test Runner Tutorial 1 - How to Setup and Run Your First Test in Node.js5 ր
Ինչ է պետք
- Նախնական գիտելիք պետք չէ. դասընթացը սկսվում է զրոյից:
Նկարագրություն
Welcome to **Tutorial 5** in the **Node.js Native Test Runner** series! In this video, we’re focusing on one of the most important concepts for writing clean, scalable, and maintainable test suites — **Hooks**. These include `before`, `after`, `beforeEach`, and `afterEach`, which help you set up and clean up test environments automatically. If your tests are starting to grow or depend on shared resources (databases, files, mock data, connections, etc.), then using hooks properly becomes **essential** to prevent duplicate code and flaky tests. ### In This Video, You Will Learn: ✅ What Hooks are and why they’re useful ✅ How to use `before` and `after` to run code **once** before/after an entire test suite ✅ How to use `beforeEach` and `afterEach` to run code **before/after every single test** ✅ How to structure test suites with shared initialization logic ✅ How to handle **async hooks** using Promises and async/await ✅ How to reset or clean up state to avoid unexpected side effects ✅ How to apply **Setup/Teardown patterns** like a professional ✅ Common mistakes to avoid when using hooks in Node.js test runner We’ll walk through clear, real-world examples, including: * Setting up
Ում համար է դասընթացը
- Նրանց, ովքեր Node.js սկսում են զրոյից:
Այս երկուսը մեր եզրակացությունն են դասընթացի մակարդակից: Նկարագրությունը հեղինակինն է: