Skip to content

Commit 12433ce

Browse files
Merge branch 'main' into coursework/sprint-3
2 parents e75c8ba + b31a586 commit 12433ce

5 files changed

Lines changed: 15 additions & 7 deletions

File tree

Sprint-1/2-mandatory-errors/4.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
const 12HourClockTime = "20:53";
2-
const 24hourClockTime = "08:53";
1+
const 12HourClockTime = "8:53pm";
2+
const 24hourClockTime = "20:53";

Sprint-2/4-mandatory-interpret/time-format.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
function pad(num) {
2-
return num.toString().padStart(2, "0");
2+
let numString = num.toString();
3+
while (numString.length < 2) {
4+
numString = "0" + numString;
5+
}
6+
return numString;
37
}
48

59
function formatTimeDisplay(seconds) {
@@ -30,5 +34,5 @@ function formatTimeDisplay(seconds) {
3034
// d) What is the value assigned to num when pad is called for the last time in this program? Explain your answer
3135
// =============> write your answer here
3236

33-
// e) What is the return value assigned to num when pad is called for the last time in this program? Explain your answer
37+
// e) What is the return value of pad when it is called for the last time in this program? Explain your answer
3438
// =============> write your answer here

Sprint-3/1-implement-and-rewrite-tests/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ to choose test values that thoroughly test a function.
88
In the `implement` directory you've got a number of functions you'll need to implement.
99
For each function, you also have a number of different cases you'll need to check for your function.
1010

11-
Write your assertions and build up your program case by case. Don't rush to a solution. The point of these assignments is to learn how to write assertions and build up a program step by step.
11+
Write your implementation and your tests to cover the cases the function should fulfil.
1212

1313
Here is a recommended order:
1414

Sprint-3/1-implement-and-rewrite-tests/implement/3-get-card-value.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,10 @@ try {
9898
getCardValue("invalid");
9999

100100
// This line will not be reached if an error is thrown as expected
101-
console.error("Error was not thrown for invalid card");
102-
} catch (error) {}
101+
console.error("Error was not thrown for invalid card 😢");
102+
} catch (e) {
103+
console.log("Error thrown for invalid card 🎉");
104+
}
103105

104106
// What other invalid card cases can you think of?
105107

Sprint-3/2-practice-tdd/repeat-str.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
function repeatStr() {
2+
// Your implementation of this function must *not* call String.prototype.repeat (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat).
3+
// The goal is to re-implement that function, not to use it.
24
return "hellohellohello";
35
}
46

0 commit comments

Comments
 (0)