|
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 | +}); |
| 12 | +test("can correctly convert midnight time", function () { |
| 13 | + assert.equal(formatAs12HourClock("00:00"), "12:00 am"); |
| 14 | +}); |
| 15 | +test("can correctly convert noon time", function () { |
| 16 | + assert.equal(formatAs12HourClock("12:00"), "12:00 pm"); |
| 17 | +}); |
| 18 | +test("can correctly convert a few mins after midnight ", function () { |
| 19 | + assert.equal(formatAs12HourClock("00:05"), "12:05 am"); |
| 20 | +}); |
| 21 | +test("can correctly convert a few mins after noon ", function () { |
| 22 | + assert.equal(formatAs12HourClock("12:05"), "12:05 pm"); |
11 | 23 | }); |
0 commit comments