codex-lv3-may-2025

Vitest Testing Assignment

Objective

Learn to write and run tests using Vitest by following the step-by-step guide and completing the practice exercises.


Assignment Overview

You will work through the Vitest learning guide, setting up a testing environment and writing tests for functions. This assignment will teach you the fundamentals of test-driven development and how to use Vitest as a testing framework.


Instructions

Step 1: Access the Learning Guide

📖 Start here: Vitest Learning Guide - Level 1

📚 Full Guide: Navigate through all 46 levels using the navigation links at the top of each page.

Note: The guide is broken into multiple levels. Start at Level 1 and work through each level sequentially using the navigation at the top of each page.

Step 2: Complete the Setup

Follow Level 1 to:

Step 3: Work Through the Guide

Complete all levels in the guide:

Use the navigation links at the top of each page to move between levels.

Step 4: Complete Challenge Levels

The challenge levels (marked with ⚡ in navigation) require you to:


Required Deliverables

Submit the following through Moodle:

  1. GitHub Repository Link
    • Create a new repository for your Vitest practice
    • Include all your test files and function files
    • Make sure the repository is public or shared with your instructor
  2. Screenshot of Passing Tests
    • Show all tests passing (green) in your terminal
    • Include at least 10+ passing tests
  3. Code Examples
    • Share at least 3 function files with their corresponding test files
    • Include examples from the challenge levels
  4. Brief Reflection (2-3 paragraphs)
    • What did you learn about testing?
    • How does writing tests first (red-green-refactor) change your coding process?
    • What challenges did you face, and how did you overcome them?

Grading Criteria

Total: 100 points


Resources


Tips


Questions? Review the complete Vitest guide or ask in the discussion forum.

Good luck! 🧪