@@ -29,10 +29,15 @@ describe("binaryLCM", () => {
29
29
} ,
30
30
) ;
31
31
32
- test ( "only whole numbers should be accepted" , ( ) => {
33
- expect ( ( ) => binaryLCM ( - 2 , - 3 ) ) . toThrowError (
34
- "numbers must be positive to determine lowest common multiple" ,
35
- ) ;
32
+ test ( "only natural numbers should be accepted" , ( ) => {
33
+ expect ( ( ) => binaryLCM ( - 2 , - 3 ) ) . toThrowError ( ) ;
34
+ expect ( ( ) => binaryLCM ( 2 , - 3 ) ) . toThrowError ( ) ;
35
+ expect ( ( ) => binaryLCM ( - 2 , 3 ) ) . toThrowError ( ) ;
36
+ } ) ;
37
+
38
+ test ( "should throw when any of the inputs is not an int" , ( ) => {
39
+ expect ( ( ) => binaryLCM ( 1 , 2.5 ) ) . toThrowError ( ) ;
40
+ expect ( ( ) => binaryLCM ( 1.5 , 2 ) ) . toThrowError ( ) ;
36
41
} ) ;
37
42
} ) ;
38
43
@@ -45,9 +50,7 @@ describe("lowestCommonMultiple", () => {
45
50
) ;
46
51
47
52
test ( "only positive numbers should be accepted" , ( ) => {
48
- expect ( ( ) => lowestCommonMultiple ( [ - 2 , - 3 ] ) ) . toThrowError (
49
- "numbers must be positive to determine lowest common multiple" ,
50
- ) ;
53
+ expect ( ( ) => lowestCommonMultiple ( [ - 2 , - 3 ] ) ) . toThrowError ( ) ;
51
54
} ) ;
52
55
53
56
test ( "at least one number must be passed in" , ( ) => {
0 commit comments