@@ -2,52 +2,52 @@ import { formatAs12HourClock } from "./timeConverter.js";
22import assert from "node:assert" ;
33import test from "node:test" ;
44
5+ test ( "can correctly convert time last minute of the day" , function ( ) {
6+ assert . equal ( formatAs12HourClock ( "23:59" ) , "11:59 pm" ) ;
7+ } ) ;
8+
9+ test ( "can correctly convert morning time" , function ( ) {
10+ assert . equal ( formatAs12HourClock ( "08:00" ) , "08:00 am" ) ;
11+ } ) ;
12+
513test ( "can correctly convert time at midnight " , function ( ) {
6- assert . equal ( formatAs12HourClock ( "00:00" ) , "12:00 AM " ) ;
14+ assert . equal ( formatAs12HourClock ( "00:00" ) , "12:00 am " ) ;
715} ) ;
816
917test ( "can correctly convert time just after midnight" , function ( ) {
10- assert . equal ( formatAs12HourClock ( "00:01" ) , "12:01 AM " ) ;
18+ assert . equal ( formatAs12HourClock ( "00:01" ) , "12:01 am " ) ;
1119} ) ;
1220
1321test ( "can correctly convert time at the first normal hour" , function ( ) {
14- assert . equal ( formatAs12HourClock ( "01:00" ) , "01:00 AM" ) ;
15- } ) ;
16-
17- test ( "can correctly convert morning time" , function ( ) {
18- assert . equal ( formatAs12HourClock ( "08:00" ) , "08:00 AM" ) ;
22+ assert . equal ( formatAs12HourClock ( "01:00" ) , "01:00 am" ) ;
1923} ) ;
2024
2125test ( "can correctly convert time on leading zeros in hour and minute" , function ( ) {
22- assert . equal ( formatAs12HourClock ( "09:05" ) , "09:05 AM " ) ;
26+ assert . equal ( formatAs12HourClock ( "09:05" ) , "09:05 am " ) ;
2327} ) ;
2428
2529test ( "can correctly convert time just last minute before noon" , function ( ) {
26- assert . equal ( formatAs12HourClock ( "11:59" ) , "11:59 AM " ) ;
30+ assert . equal ( formatAs12HourClock ( "11:59" ) , "11:59 am " ) ;
2731} ) ;
2832
2933test ( "can correctly convert time to PM at noon" , function ( ) {
30- assert . equal ( formatAs12HourClock ( "12:00" ) , "12:00 PM " ) ;
34+ assert . equal ( formatAs12HourClock ( "12:00" ) , "12:00 pm " ) ;
3135} ) ;
3236
3337test ( "can correctly convert time just afternoon" , function ( ) {
34- assert . equal ( formatAs12HourClock ( "12:01" ) , "12:01 PM " ) ;
38+ assert . equal ( formatAs12HourClock ( "12:01" ) , "12:01 pm " ) ;
3539} ) ;
3640
3741test ( "can correctly convert time last minute of the noon hour" , function ( ) {
38- assert . equal ( formatAs12HourClock ( "12:59" ) , "12:59 PM " ) ;
42+ assert . equal ( formatAs12HourClock ( "12:59" ) , "12:59 pm " ) ;
3943} ) ;
4044
4145test ( "can correctly convert time first hour after noon" , function ( ) {
42- assert . equal ( formatAs12HourClock ( "13:00" ) , "01:00 PM " ) ;
46+ assert . equal ( formatAs12HourClock ( "13:00" ) , "01:00 pm " ) ;
4347} ) ;
4448
45- test ( "correctly convert time after 12:00" , function ( ) {
46- assert . equal ( formatAs12HourClock ( "23:00" ) , "11:00 PM" ) ;
47- } ) ;
48-
49- test ( "can correctly convert time last minute of the day" , function ( ) {
50- assert . equal ( formatAs12HourClock ( "23:59" ) , "11:59 PM" ) ;
49+ test ( "correctly convert time before midnight" , function ( ) {
50+ assert . equal ( formatAs12HourClock ( "23:00" ) , "11:00 pm" ) ;
5151} ) ;
5252
5353/*
0 commit comments