Skip to content

Commit

Permalink
test: load large amount of data won't cause error (#762)
Browse files Browse the repository at this point in the history
  • Loading branch information
himself65 committed Apr 24, 2024
1 parent 13d8d7c commit aeefc77
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions packages/core/tests/ingestion/ingestion-pipeline.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { Document } from "llamaindex/Node";
import { IngestionPipeline } from "llamaindex/ingestion/IngestionPipeline";
import { test } from "vitest";

// Refs: https://github.com/run-llama/LlamaIndexTS/pull/760
test("load large data should not cause RangeError #760", async () => {
const pipeline = new IngestionPipeline({
reader: {
loadData: async () => {
return Array.from(
{ length: 1e6 },
(_, i) =>
new Document({
id_: `${i}`,
text: "some text",
}),
);
},
},
});
await pipeline.prepareInput();
});

0 comments on commit aeefc77

Please sign in to comment.