Skip to content

Commit 6a11e56

Browse files
committed
checked all the edge cases
1 parent 18ec108 commit 6a11e56

1 file changed

Lines changed: 17 additions & 5 deletions

File tree

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
1-
import {formatAs12HourClock} from "./timeConverter.js";
1+
import { formatAs12HourClock } from "./timeConverter.js";
22
import assert from "node:assert";
33
import test from "node:test";
44

5-
test("correctly convert time after 12:00", function(){
6-
assert.equal(formatAs12HourClock("23:00"), "11:00 pm");
5+
test("correctly convert time after 12:00", function () {
6+
assert.equal(formatAs12HourClock("14:00"), "02:00 pm");
77
});
88

9-
test("can correctly convert morning time", function() {
10-
assert.equal(formatAs12HourClock("08:00"), "08:00 am");
9+
test("can correctly convert morning time", function () {
10+
assert.equal(formatAs12HourClock("08:00"), "08:00 am");
11+
});
12+
13+
test("can correctly convert midnight time", function () {
14+
assert.equal(formatAs12HourClock("00:00"), "12:00 am");
15+
});
16+
17+
test("can correctly convert midday time", function () {
18+
assert.equal(formatAs12HourClock("12:00"), "12:00 pm");
19+
});
20+
21+
test("can correctly convert 22:00 and 23:00 time", function () {
22+
assert.equal(formatAs12HourClock("22:00"), "10:00 pm");
1123
});

0 commit comments

Comments
 (0)