File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,19 @@ describe("pagination", () => {
9696 expect . assertions ( 7 ) ;
9797 } ) ;
9898
99+ /**
100+ * This test makes a DynamoDB paginated batch get request for 5 items, with keys 1-2-3-4-5, in this exact order.
101+ *
102+ * The first returned page contains items 2 and 1 (order switched to simulate the unpredictability of the order of the
103+ * items returned by the DDB API BatchGetItem command), plus unprocessed keys 3 and 4. The second page contains the
104+ * items 3 and 4, and no further unprocessed keys.
105+ *
106+ * Item 5 is asked for, but we consider that the table does not contain it, so it's not returned at all. That's a
107+ * valid use case and does not generate an error.
108+ *
109+ * In the second part of the test, another paginated request is done for 2 items, with keys 1 and 1. So the same
110+ * item is requested twice. As the API will return an error, we want to catch the generated SDK exception.
111+ */
99112 it ( "processes batch items until all items are processed or an error is received" , async ( ) => {
100113 const ddb = new DynamoDB ( {
101114 credentials : {
You can’t perform that action at this time.
0 commit comments