Skip to content

Commit

Permalink
Update tests to pass.
Browse files Browse the repository at this point in the history
  • Loading branch information
VDubber committed Aug 13, 2024
1 parent 554a2b8 commit 072d620
Showing 1 changed file with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ describe('iterateEntities', () => {
const nonMatchingEntities = times(25, () =>
createTestEntity({ _type: uuid() }),
);
const matchingEntities = times(25, () =>
const matchingEntities = times(25000, () =>
createTestEntity({ _type: matchingType }),
);

Expand All @@ -539,21 +539,21 @@ describe('iterateEntities', () => {
};

await store.iterateEntities({ _type: matchingType }, collectEntity);
expect(Array.from(collectedEntities.values())).toEqual([
bufferedEntity,
...matchingEntities,
]);
expect(collectedEntities.size).toEqual(matchingEntities.length + 1);
expect(Array.from(collectedEntities.keys()).sort()).toEqual(
[bufferedEntity, ...matchingEntities].map((e) => e._key).sort(),
);
});

test('should allow concurrent executions of the iteratee function.', async () => {
const { storageDirectoryPath, store } = setupFileSystemObjectStore();

const matchingType = uuid();

const nonMatchingEntities = times(25, () =>
const nonMatchingEntities = times(1_000, () =>
createTestEntity({ _type: uuid() }),
);
const matchingEntities = times(300, () =>
const matchingEntities = times(1_000, () =>
createTestEntity({ _type: matchingType }),
);

Expand Down Expand Up @@ -581,11 +581,11 @@ describe('iterateEntities', () => {
},
5,
);
console.log('length', collectedEntities.size);
expect(Array.from(collectedEntities.values())).toEqual([
bufferedEntity,
...matchingEntities,
]);

expect(collectedEntities.size).toEqual(matchingEntities.length + 1);
expect(Array.from(collectedEntities.keys()).sort()).toEqual(
[bufferedEntity, ...matchingEntities].map((e) => e._key).sort(),
);
});

test('should allow extended types to be iterated', async () => {
Expand Down

0 comments on commit 072d620

Please sign in to comment.