-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: load large amount of data won't cause error (#762)
- Loading branch information
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}); |