@@ -2,31 +2,29 @@ import {formatAs12HourClock} from "./timeConverter.js";
22import assert from "node:assert" ;
33import test from "node:test" ;
44
5- test ( "can return 'invalid input.' " , function ( ) {
6- assert . equal ( formatAs12HourClock ( "25 :00" ) , "invalid input. " ) ;
5+ test ( "correctly convert time afternoon time: 23:00 " , function ( ) {
6+ assert . equal ( formatAs12HourClock ( "23 :00" ) , "11:00pm " ) ;
77} ) ;
88
9- test ( "can return 'invalid input.'" , function ( ) {
10- assert . equal ( formatAs12HourClock ( "-01:00" ) , "invalid input." ) ;
11- } )
12-
13- test ( "can correctly convert morning time 24:12" , function ( ) {
14- assert . equal ( formatAs12HourClock ( "24:12" ) , "12:12am" ) ;
9+ test ( "can correctly convert morning time 08:00" , function ( ) {
10+ assert . equal ( formatAs12HourClock ( "08:00" ) , "8:00am" ) ;
1511} ) ;
1612
17- test ( "can correctly convert morning time 00:12 " , function ( ) {
18- assert . equal ( formatAs12HourClock ( "00:12 " ) , "12:12am " ) ;
13+ test ( "can correctly convert morning time 11:59 " , function ( ) {
14+ assert . equal ( formatAs12HourClock ( "11:59 " ) , "11:59am " ) ;
1915} ) ;
2016
21- test ( "can correctly convert afternoon time 12:12 " , function ( ) {
22- assert . equal ( formatAs12HourClock ( "12:12 " ) , "12:12pm " ) ;
17+ test ( "can correctly convert afternoon time 23:59 " , function ( ) {
18+ assert . equal ( formatAs12HourClock ( "23:159 " ) , "11:59pm " ) ;
2319} ) ;
2420
25- test ( "can correctly convert afternoon time 15:30 " , function ( ) {
26- assert . equal ( formatAs12HourClock ( "15:30 " ) , "3:30pm " ) ;
21+ test ( "can correctly convert morning time 00:00 " , function ( ) {
22+ assert . equal ( formatAs12HourClock ( "00:00 " ) , "12:00am " ) ;
2723} ) ;
2824
29- test ( "can correctly convert morning time 03:45 " , function ( ) {
30- assert . equal ( formatAs12HourClock ( "03:45 " ) , "3:45am " ) ;
25+ test ( "can correctly convert afternoon time 12:00 " , function ( ) {
26+ assert . equal ( formatAs12HourClock ( "12:00 " ) , "12:00pm " ) ;
3127} ) ;
3228
29+
30+
0 commit comments