@@ -6,3 +6,56 @@ import { isProperFraction } from "../implement/2-is-proper-fraction.js";
66test ( `should return false when denominator is zero` , ( ) => {
77 expect ( isProperFraction ( 1 , 0 ) ) . toEqual ( false ) ;
88} ) ;
9+
10+ test ( `should return true for basic proper fraction` , ( ) => {
11+ expect ( isProperFraction ( 1 , 2 ) ) . toEqual ( true ) ;
12+ } ) ;
13+
14+ test ( `should return true for decimal proper fraction` , ( ) => {
15+ expect ( isProperFraction ( 0.5 , 1.5 ) ) . toEqual ( true ) ;
16+ } ) ;
17+
18+ test ( `should return true for 0 numerator proper fraction` , ( ) => {
19+ expect ( isProperFraction ( 0 , 5 ) ) . toEqual ( true ) ;
20+ } ) ;
21+
22+ test ( `should return true for negative numerator proper fraction` , ( ) => {
23+ expect ( isProperFraction ( - 9 , 1 ) ) . toEqual ( true ) ;
24+ } ) ;
25+
26+ test ( `should return true for negative proper fraction` , ( ) => {
27+ expect ( isProperFraction ( - 7 , - 3 ) ) . toEqual ( true ) ;
28+ } ) ;
29+
30+ test ( `should return true for very small denominator proper fraction` , ( ) => {
31+ expect ( isProperFraction ( 1 , 1000000 ) ) . toEqual ( true ) ;
32+ } ) ;
33+
34+ // Improper fractions
35+ test ( `should return false for very small denominator proper fraction` , ( ) => {
36+ expect ( isProperFraction ( 1.2 , 1.1 ) ) . toEqual ( false ) ;
37+ } ) ;
38+
39+ test ( `should return false for large numerator improper fraction` , ( ) => {
40+ expect ( isProperFraction ( 5 , 3 ) ) . toEqual ( false ) ;
41+ } ) ;
42+
43+ test ( `should return false for both equal numbers improper fraction` , ( ) => {
44+ expect ( isProperFraction ( 4 , 4 ) ) . toEqual ( false ) ;
45+ } ) ;
46+
47+ test ( `should return false for 0 denominator improper fraction` , ( ) => {
48+ expect ( isProperFraction ( 7 , 0 ) ) . toEqual ( false ) ;
49+ } ) ;
50+
51+ test ( `should return false for both 0 improper fraction` , ( ) => {
52+ expect ( isProperFraction ( 0 , 0 ) ) . toEqual ( false ) ;
53+ } ) ;
54+
55+ test ( `should return false for both negative improper fraction` , ( ) => {
56+ expect ( isProperFraction ( - 4 , - 4 ) ) . toEqual ( false ) ;
57+ } ) ;
58+
59+ test ( `should return false for negative denominator improper fraction` , ( ) => {
60+ expect ( isProperFraction ( 2 , - 9 ) ) . toEqual ( false ) ;
61+ } ) ;
0 commit comments