Skip to content

Commit 050f6e6

Browse files
committed
modified tests according to Abdi's comments.
1 parent 23d7cfd commit 050f6e6

1 file changed

Lines changed: 14 additions & 16 deletions

File tree

‎format-clock-edge-cases/timeConverter.test.js‎

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,29 @@ import {formatAs12HourClock} from "./timeConverter.js";
22
import assert from "node:assert";
33
import test from "node:test";
44

5-
test("can return 'invalid input.'", function(){
6-
assert.equal(formatAs12HourClock("25:00"), "invalid input.");
5+
test("correctly convert time afternoon time: 23:00", function(){
6+
assert.equal(formatAs12HourClock("23:00"), "11:00pm");
77
});
88

9-
test("can return 'invalid input.'", function(){
10-
assert.equal(formatAs12HourClock("-01:00"), "invalid input.");
11-
})
12-
13-
test("can correctly convert morning time 24:12", function() {
14-
assert.equal(formatAs12HourClock("24:12"), "12:12am");
9+
test("can correctly convert morning time 08:00", function() {
10+
assert.equal(formatAs12HourClock("08:00"), "8:00am");
1511
});
1612

17-
test("can correctly convert morning time 00:12", function() {
18-
assert.equal(formatAs12HourClock("00:12"), "12:12am");
13+
test("can correctly convert morning time 11:59", function() {
14+
assert.equal(formatAs12HourClock("11:59"), "11:59am");
1915
});
2016

21-
test("can correctly convert afternoon time 12:12", function() {
22-
assert.equal(formatAs12HourClock("12:12"), "12:12pm");
17+
test("can correctly convert afternoon time 23:59", function() {
18+
assert.equal(formatAs12HourClock("23:159"), "11:59pm");
2319
});
2420

25-
test("can correctly convert afternoon time 15:30", function() {
26-
assert.equal(formatAs12HourClock("15:30"), "3:30pm");
21+
test("can correctly convert morning time 00:00", function() {
22+
assert.equal(formatAs12HourClock("00:00"), "12:00am");
2723
});
2824

29-
test("can correctly convert morning time 03:45", function() {
30-
assert.equal(formatAs12HourClock("03:45"), "3:45am");
25+
test("can correctly convert afternoon time 12:00", function() {
26+
assert.equal(formatAs12HourClock("12:00"), "12:00pm");
3127
});
3228

29+
30+

0 commit comments

Comments
 (0)