Skip to content

Commit 0cfe806

Browse files
committed
write and test edge cases
1 parent 952149c commit 0cfe806

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

Sprint-2/5-stretch-extend/format-time.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,31 @@ console.assert(
2323
currentOutput2 === targetOutput2,
2424
`current output: ${currentOutput2}, target output: ${targetOutput2}`
2525
);
26+
const currentOutput3 = formatAs12HourClock("00:00");
27+
const targetOutput3 = "00:00 am";
28+
console.assert(
29+
currentOutput3 === targetOutput3,
30+
`current output: ${currentOutput3}, target output: ${targetOutput3}`
31+
);
32+
33+
const currentOutput4 = formatAs12HourClock("24:00");
34+
const targetOutput4 = "12:00 pm";
35+
console.assert(
36+
currentOutput4 === targetOutput4,
37+
`current output: ${currentOutput4}, target output: ${targetOutput4}`
38+
);
39+
40+
const currentOutput5 = formatAs12HourClock("12:00");
41+
const targetOutput5 = "12:00 am";
42+
console.assert(
43+
currentOutput5 === targetOutput5,
44+
`current output: ${currentOutput5}, target output: ${targetOutput}`
45+
);
46+
47+
const currentOutput5 = formatAs12HourClock(":00");
48+
const targetOutput5 = "12:00 am";
49+
console.assert(
50+
currentOutput5 === targetOutput5,
51+
`current output: ${currentOutput5}, target output: ${targetOutput}`
52+
);
53+

0 commit comments

Comments
 (0)