This activity is intended to supplement the CS4530 lecture on test-driven development.
Steps
- Download and unpack the starter code.
- 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 asit("<testable beahvior>", () => {})
intests/transcript.service.spec.ts
. - 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
. - Add Vitest tests for your testable behaviors.
Implement a method(Not required.)addGrade
tosrc/transcript.service.ts
that passes your tests.- Submit on Gradescope.