Skip to content

Commit d2e9cba

Browse files
committed
many files test
1 parent 8a271b2 commit d2e9cba

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

packages/compass-user-data/src/user-data.spec.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,20 @@ describe('user-data', function () {
158158
expect(mongoshData?.[1]).to.be.instanceOf(Stats);
159159
}
160160
});
161+
162+
it('reads many number of files', async function () {
163+
const files = Array.from({ length: 10000 }, (_, i) => [
164+
`data${i}.json`,
165+
JSON.stringify({ name: `VSCode${i}` }),
166+
]);
167+
168+
await Promise.all(
169+
files.map(([filepath, data]) => writeFileToStorage(filepath, data))
170+
);
171+
172+
const result = await getUserData().readAll();
173+
expect(result.data).to.have.lengthOf(10000);
174+
});
161175
});
162176

163177
context('UserData.readOne', function () {

0 commit comments

Comments
 (0)