← All Learning Paths

Testing & TDD

A TDD path through the test pyramid, doubles, property testing, and CI quality gates.

technicalintermediate10 nodes13.33h total

A comprehensive testing and TDD learning path covering unit tests, integration tests, E2E, mocking, TDD methodology, coverage, and CI integration for building reliable, well-tested software.

  1. Wire "Vitest" into a scratch testing project, following "describe / it describe(name: string, fn: () => void): void", and record one working request/response pair.

    Completion criteria: Attach one successful call and one invalid call against "Vitest", citing "expect expect(actual: unknown): Assertion" as the documented surface.

    Next step: Pytest

    ⏱ 1h

  2. Read "Pytest"'s documented surface around "@pytest.mark.parametrize @pytest.mark.parametrize(argnames, argvalues)", then build a minimal endpoint and log the response.

    Prerequisites: Vitest

    Completion criteria: Attach one successful call and one invalid call against "Pytest", citing "@pytest.mark.parametrize @pytest.mark.parametrize(argnames, argvalues)" as the documented surface.

    Next step: Playwright

    ⏱ 1h

  3. Stand up "Playwright" for a testing task, confirm "Web-first assertions expect(locator: Locator).toBeVisible(options?: { timeout?: number })" holds, and document one failure you triggered.

    Prerequisites: Pytest

    Completion criteria: Attach one successful call and one invalid call against "Playwright", citing "page.route page.route(url: string | RegExp, handler: (route: Route) => Promise<void>):" as the documented surface.

    Next step: Supertest

    ⏱ 1h

  4. Wire "Supertest" into a scratch testing project, following ".send .send(body: object | string): Test", and record one working request/response pair.

    Prerequisites: Playwright

    Completion criteria: Attach one successful call and one invalid call against "Supertest", citing ".send .send(body: object | string): Test" as the documented surface.

    Next step: MSW

    ⏱ 1h

  5. Read "MSW"'s documented surface around "http http.get(path, resolver): HttpHandler", then build a minimal endpoint and log the response.

    Prerequisites: Supertest

    Completion criteria: Run a request against "MSW", paste the response, and add one deliberately invalid call with its error.

    Next step: Add a Test Data Builder

    ⏱ 1h

  6. Execute "Add a Test Data Builder" end to end, then repeat the last step with one parameter changed and compare "Make tests readable and resilient to schema changes by constructing only the data each test".

    Prerequisites: MSW

    Completion criteria: Deliver a transcript of "Add a Test Data Builder" with each step's command and observed state, ending at "Make tests readable and resilient to schema changes by constructing only the data each test".

    Next step: Add a Performance Budget to CI

    ⏱ 0.5h

  7. Run "Install a size-checking tool and define budgets for the files that matter." from "Add a Performance Budget to CI" and confirm the documented result "A pull request that exceeds the budget fails the check.".

    Prerequisites: Add a Test Data Builder

    Completion criteria: Show the command for every step of "Add a Performance Budget to CI" and paste the output proving "Install a size-checking tool and define budgets for the files that matter."; then note the step where "A pull request that exceeds the budget fails the check." appears.

    Next step: Testing Strategies: Unit, Integration, and E2E

    ⏱ 0.5h

  8. Compare "Snapshot Testing: Use and Abuse, and Property-Based Testing" with "Structure your tests across the test pyramid: fast unit tests, contract-driven integration" in "Testing Strategies: Unit, Integration, and E2E" and state which trade-off you would accept in testing code.

    Prerequisites: Add a Performance Budget to CI

    Completion criteria: Record a short walkthrough of "Testing Strategies: Unit, Integration, and E2E" with timestamps at "Snapshot Testing: Use and Abuse, and Property-Based Testing" and "Structure your tests across the test pyramid: fast unit tests, contract-driven integration", plus the commit that applies it.

    Next step: Generate a Test Matrix with Exclusions

    ⏱ 1h

  9. Solve "Generate a Test Matrix with Exclusions" for testing work: turn JSON object: { dimensions: { [name]: string[] }, excludePairs?: [{ into {total:4,selected:3,sample:[{browser:chromium,os:linux},{browser:chrom and pass both samples.

    Prerequisites: Testing Strategies: Unit, Integration, and E2E

    Completion criteria: Attach the solution file for "Testing & TDD", two passing sample runs, and one failing run whose error matches the contract.

    Next step: Capstone: Testing & TDD

    ⏱ 0.33h

  10. Deliver the "Build a Persistent Todo CLI with Node.js and JSON Storage" blueprint with "add writes a task with id, title, optional tags, and created timestamp, then prints the id" working and "list filters by --status and --tag and prints tasks grouped by pending or done" recorded as evidence.

    Prerequisites: Testing Strategies: Unit, Integration, and E2E, Generate a Test Matrix with Exclusions

    Completion criteria: Deliver "add writes a task with id, title, optional tags, and created timestamp, then prints the id" and paste the test output where the acceptance test passes; include the test name and command.

    Next step: Run the capstone's tests, publish the repository, and demo it to a reviewer.

    ⏱ 4h