master
1class User {
2 constructor(bodyWeight: 0) {
3 this.bodyWeight = bodyWeight;
4 }
5
6 switchTo(program) { }
7
8 nextWorkoutFor(routine) {
9 return new Workout(this.bodyWeight);
10 }
11}
12
13class StrongliftsProgram {
14 routine(name) {
15 }
16}
17
18class Workout {
19 constructor(bodyWeight = 0) {
20 this.bodyWeight = bodyWeight;
21 }
22}
23
24describe("User", () => {
25 it ("creates the next workout", function() {
26 const program = new StrongliftsProgram();
27 const user = new User(240);
28 const routineA = program.routine("A")
29
30 user.switchTo(program)
31 const workout = user.nextWorkoutFor(routineA);
32
33 expect(workout.bodyWeight).toEqual(240);
34 });
35});