|
1 | | -import {formatAs12HourClock} from "./timeConverter.js"; |
| 1 | +import { formatAs12HourClock } from "./timeConverter.js"; |
2 | 2 | import assert from "node:assert"; |
3 | 3 | import test from "node:test"; |
4 | 4 |
|
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("23:00"), "11:00 pm"); |
7 | 7 | }); |
8 | 8 |
|
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 | 11 | }); |
12 | 12 |
|
13 | | - |
14 | | -test("correctly convert midnight", function() { |
15 | | - assert.equal(formatAs12HourClock("00:00"), "12:00 am"); |
| 13 | +test("correctly convert midnight", function () { |
| 14 | + assert.equal(formatAs12HourClock("00:00"), "12:00 am"); |
16 | 15 | }); |
17 | 16 |
|
18 | | -test("correctly convert noon", function() { |
19 | | - assert.equal(formatAs12HourClock("12:00"), "12:00 pm"); |
| 17 | +test("correctly convert noon", function () { |
| 18 | + assert.equal(formatAs12HourClock("12:00"), "12:00 pm"); |
20 | 19 | }); |
21 | 20 |
|
22 | | -test("correctly convert single digit hour in the morning", function() { |
23 | | - assert.equal(formatAs12HourClock("01:30"), "01:30 am"); |
| 21 | +test("correctly convert single digit hour in the morning", function () { |
| 22 | + assert.equal(formatAs12HourClock("01:30"), "01:30 am"); |
24 | 23 | }); |
25 | 24 |
|
26 | | -test("correctly convert single digit hour in the afternoon", function() { |
27 | | - assert.equal(formatAs12HourClock("13:45"), "01:45 pm"); |
| 25 | +test("correctly convert single digit hour in the afternoon", function () { |
| 26 | + assert.equal(formatAs12HourClock("13:45"), "01:45 pm"); |
28 | 27 | }); |
29 | 28 |
|
30 | | -test("correctly convert time with leading zeros", function() { |
31 | | - assert.equal(formatAs12HourClock("09:05"), "09:05 am"); |
| 29 | +test("correctly convert time with leading zeros", function () { |
| 30 | + assert.equal(formatAs12HourClock("09:05"), "09:05 am"); |
32 | 31 | }); |
33 | 32 |
|
| 33 | +test("correctly convert double digit hour in the afternoon", function () { |
| 34 | + assert.equal(formatAs12HourClock("15:20"), "03:20 pm"); |
| 35 | +}); |
0 commit comments