@@ -1646,7 +1646,7 @@ describe("sampleFromSchema", () => {
1646
1646
expect ( sampleFromSchema ( definition ) ) . toEqual ( expected )
1647
1647
} )
1648
1648
1649
- it ( "should handle minimum" , ( ) => {
1649
+ it ( "should handle minimum for number " , ( ) => {
1650
1650
const definition = {
1651
1651
type : "number" ,
1652
1652
minimum : 5 ,
@@ -1657,7 +1657,7 @@ describe("sampleFromSchema", () => {
1657
1657
expect ( sampleFromSchema ( definition ) ) . toEqual ( expected )
1658
1658
} )
1659
1659
1660
- it ( "should handle exclusiveMinimum" , ( ) => {
1660
+ it ( "should handle exclusiveMinimum for number " , ( ) => {
1661
1661
const definition = {
1662
1662
type : "number" ,
1663
1663
exclusiveMinimum : 5 ,
@@ -1667,7 +1667,7 @@ describe("sampleFromSchema", () => {
1667
1667
expect ( sampleFromSchema ( definition ) ) . toEqual ( expected )
1668
1668
} )
1669
1669
1670
- it ( "should handle maximum" , ( ) => {
1670
+ it ( "should handle maximum for number " , ( ) => {
1671
1671
const definition = {
1672
1672
type : "number" ,
1673
1673
maximum : - 1 ,
@@ -1678,7 +1678,7 @@ describe("sampleFromSchema", () => {
1678
1678
expect ( sampleFromSchema ( definition ) ) . toEqual ( expected )
1679
1679
} )
1680
1680
1681
- it ( "should handle exclusiveMaximum" , ( ) => {
1681
+ it ( "should handle exclusiveMaximum for number " , ( ) => {
1682
1682
const definition = {
1683
1683
type : "number" ,
1684
1684
exclusiveMaximum : - 1 ,
@@ -1689,7 +1689,7 @@ describe("sampleFromSchema", () => {
1689
1689
expect ( sampleFromSchema ( definition ) ) . toEqual ( expected )
1690
1690
} )
1691
1691
1692
- it ( "should handle multipleOf" , ( ) => {
1692
+ it ( "should handle multipleOf for number " , ( ) => {
1693
1693
const definition = {
1694
1694
type : "number" ,
1695
1695
minimum : 22 ,
@@ -1701,6 +1701,61 @@ describe("sampleFromSchema", () => {
1701
1701
expect ( sampleFromSchema ( definition ) ) . toStrictEqual ( expected )
1702
1702
} )
1703
1703
1704
+ it ( "should handle minimum for integer" , ( ) => {
1705
+ const definition = {
1706
+ type : "integer" ,
1707
+ minimum : 5 ,
1708
+ }
1709
+
1710
+ const expected = 5
1711
+
1712
+ expect ( sampleFromSchema ( definition ) ) . toEqual ( expected )
1713
+ } )
1714
+
1715
+ it ( "should handle exclusiveMinimum for integer" , ( ) => {
1716
+ const definition = {
1717
+ type : "integer" ,
1718
+ exclusiveMinimum : 5 ,
1719
+ }
1720
+ const expected = 6
1721
+
1722
+ expect ( sampleFromSchema ( definition ) ) . toEqual ( expected )
1723
+ } )
1724
+
1725
+ it ( "should handle maximum for integer" , ( ) => {
1726
+ const definition = {
1727
+ type : "integer" ,
1728
+ maximum : - 1 ,
1729
+ }
1730
+
1731
+ const expected = - 1
1732
+
1733
+ expect ( sampleFromSchema ( definition ) ) . toEqual ( expected )
1734
+ } )
1735
+
1736
+ it ( "should handle exclusiveMaximum for integer" , ( ) => {
1737
+ const definition = {
1738
+ type : "integer" ,
1739
+ exclusiveMaximum : - 1 ,
1740
+ }
1741
+
1742
+ const expected = - 2
1743
+
1744
+ expect ( sampleFromSchema ( definition ) ) . toEqual ( expected )
1745
+ } )
1746
+
1747
+ it ( "should handle multipleOf for integer" , ( ) => {
1748
+ const definition = {
1749
+ type : "integer" ,
1750
+ minimum : 22 ,
1751
+ multipleOf : 3 ,
1752
+ }
1753
+
1754
+ const expected = 24
1755
+
1756
+ expect ( sampleFromSchema ( definition ) ) . toStrictEqual ( expected )
1757
+ } )
1758
+
1704
1759
it ( "should handle minLength" , ( ) => {
1705
1760
const definition = {
1706
1761
type : "string" ,
0 commit comments