Menu Expand Search
CS4530, Summer 2025

Vitest and Test-Driven Development

This activity is intended to supplement the CS4530 lecture on test-driven development.

Steps

  1. Download and unpack the starter code.
  2. Write down two testable behaviors for the addGrade function corresponding to the condition of satisfaction that “the user can add a new grade for an existing student.” These should be written as it("<testable beahvior>", () => {}) in tests/transcript.service.spec.ts.
  3. Identify at least two exceptional conditions or design decisions associated with these testable behaviors, and document these as comments in tests/transcript.service.spec.ts.
  4. Add Vitest tests for your testable behaviors.
  5. Implement a method addGrade to src/transcript.service.ts that passes your tests. (Not required.)
  6. Submit on Gradescope.