Skip to content

Commit 23c127d

Browse files
committed
formatted documents
1 parent 050f6e6 commit 23c127d

2 files changed

Lines changed: 14 additions & 17 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function formatAs12HourClock(time) {
1212
return `${hours - 12}:${minutes}pm`;
1313
} else {
1414
return `${hours}:${minutes}am`;
15-
}
1615
}
16+
}
1717

1818
export { formatAs12HourClock };
Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,27 @@
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 afternoon time: 23:00", function(){
6-
assert.equal(formatAs12HourClock("23:00"), "11:00pm");
5+
test("correctly convert time afternoon time: 23:00", function () {
6+
assert.equal(formatAs12HourClock("23:00"), "11:00pm");
77
});
88

9-
test("can correctly convert morning time 08:00", function() {
10-
assert.equal(formatAs12HourClock("08:00"), "8:00am");
9+
test("can correctly convert morning time 08:00", function () {
10+
assert.equal(formatAs12HourClock("08:00"), "8:00am");
1111
});
1212

13-
test("can correctly convert morning time 11:59", function() {
14-
assert.equal(formatAs12HourClock("11:59"), "11:59am");
13+
test("can correctly convert morning time 11:59", function () {
14+
assert.equal(formatAs12HourClock("11:59"), "11:59am");
1515
});
1616

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

21-
test("can correctly convert morning time 00:00", function() {
22-
assert.equal(formatAs12HourClock("00:00"), "12:00am");
21+
test("can correctly convert morning time 00:00", function () {
22+
assert.equal(formatAs12HourClock("00:00"), "12:00am");
2323
});
2424

25-
test("can correctly convert afternoon time 12:00", function() {
26-
assert.equal(formatAs12HourClock("12:00"), "12:00pm");
25+
test("can correctly convert afternoon time 12:00", function () {
26+
assert.equal(formatAs12HourClock("12:00"), "12:00pm");
2727
});
28-
29-
30-

0 commit comments

Comments
 (0)