1- import { formatAs12HourClock } from "./timeConverter.js" ;
1+ import { formatAs12HourClock } from "./timeConverter.js" ;
22import assert from "node:assert" ;
33import 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 ( "23:00" ) , "11:00 pm" ) ;
77} ) ;
88
9- test ( "can correctly convert morning time" , function ( ) {
10- assert . equal ( formatAs12HourClock ( "08:00" ) , "08:00 am" ) ;
11- assert . equal ( formatAs12HourClock ( "01:00" ) , "01:00 am" ) ;
9+ test ( "can correctly convert morning time" , function ( ) {
10+ assert . equal ( formatAs12HourClock ( "08:00" ) , "08:00 am" ) ;
11+ assert . equal ( formatAs12HourClock ( "01:00" ) , "01:00 am" ) ;
1212} ) ;
1313
14- test ( "can correctly convert time with minutes for am" , function ( ) {
15- assert . equal ( formatAs12HourClock ( "08:35" ) , "08:35 am" ) ;
14+ test ( "can correctly convert time with minutes for am" , function ( ) {
15+ assert . equal ( formatAs12HourClock ( "08:35" ) , "08:35 am" ) ;
1616} ) ;
1717
18- test ( "can correctly convert time with minutes for pm" , function ( ) {
19- assert . equal ( formatAs12HourClock ( "18:35" ) , "06:35 pm" ) ;
18+ test ( "can correctly convert time with minutes for pm" , function ( ) {
19+ assert . equal ( formatAs12HourClock ( "18:35" ) , "06:35 pm" ) ;
2020} ) ;
2121
22- test ( "can correctly convert time with minutes with 0 pad such as 12:04" , function ( ) {
23- assert . equal ( formatAs12HourClock ( "13:04" ) , "01:04 pm" ) ;
22+ test ( "can correctly convert time with minutes with 0 pad such as 12:04" , function ( ) {
23+ assert . equal ( formatAs12HourClock ( "13:04" ) , "01:04 pm" ) ;
2424} ) ;
2525
26- test ( "can correctly convert time with hour being 00 to show as 12 am" , function ( ) {
27- assert . equal ( formatAs12HourClock ( "00:00" ) , "12:00 am" ) ;
28- assert . equal ( formatAs12HourClock ( "00:30" ) , "12:30 am" ) ;
26+ test ( "can correctly convert time with hour being 00 to show as 12 am" , function ( ) {
27+ assert . equal ( formatAs12HourClock ( "00:00" ) , "12:00 am" ) ;
28+ assert . equal ( formatAs12HourClock ( "00:30" ) , "12:30 am" ) ;
2929} ) ;
3030
31- test ( "can correctly convert time with just after midnight to still show 12 am with minutes added" , function ( ) {
32- assert . equal ( formatAs12HourClock ( "00:01" ) , "12:01 am" ) ;
33- } ) ;
31+ test ( "can correctly convert time with just after midnight to still show 12 am with minutes added" , function ( ) {
32+ assert . equal ( formatAs12HourClock ( "00:01" ) , "12:01 am" ) ;
33+ } ) ;
0 commit comments