@@ -35,4 +35,89 @@ function chunkArrayTest() {
// [[1, 2, 3],
// [4, 5, 6],
// [7, 8]]
+
+ const letJsonObj = {
+ productList: [
+ {
+ id: 1,
+ name: "商品A",
+ price: 29.9
+ },
+ id: 2,
+ name: "商品B",
+ price: 39.9
+ id: 3,
+ name: "商品C",
+ price: 19.9
+ id: 4,
+ name: "商品D",
+ price: 49.9
+ id: 5,
+ name: "商品E",
+ price: 59.9
+ id: 6,
+ name: "商品F",
+ price: 69.9
+ id: 7,
+ name: "商品G",
+ price: 79.9
+ }
+ ],
+ pageSize: 3,
+ expectedChunks: [
+ [
+ ]
+ };
+ const chunker = chunkSecondArray(letJsonObj.productList, letJsonObj.pageSize);
}