Node.js Native Test Runner Tutorial

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

رایگان5 درس53 دقیقهمقدماتی

کانال ProgrammingKnowledge

نوامبر 2025

4 روز پیش بررسی شد

چه یاد می‌گیری

  • Hooks (before, after, beforeEach, afterEach) Setup/Teardown
  • Test Asynchronous Code (Callbacks, Promises, Async/Await
  • How To Organize Tests, Test Suites, and Subtests
  • How To Use Assertions and Handle Errors
  • How to Setup and Run Your First Test in Node.js

برگرفته از درس‌های خود دوره، به بیان نویسنده.

رایگان

این دوره رایگان است و در یوتیوب منتشر شده. نویسنده‌اش همان کانال است، ما فقط مرتب می‌کنیم و بررسی می‌کنیم که ویدیوها باز شوند.

شروع دوره

موضوع‌های مرتبط

این دوره شامل

  • 53 دقیقه ویدیو
  • 5 درس
  • سطح: مقدماتی
  • زبان: English
  • یادمان می‌ماند کجا بودی
  • کاملاً رایگان، بدون کارت

درس‌ها

1 بخش · 5 درس · 53 دقیقه مدت کل

چه چیزی لازم است

  • به دانش قبلی نیاز نیست: دوره از صفر شروع می‌شود.

توضیحات

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 را از صفر شروع می‌کنند.

این دو مورد برداشت ما از سطح دوره است. توضیحات از خود نویسنده است.

Picked on Temu

Node.js Native Test Runner Tutorial، کانال ProgrammingKnowledge