From 072d62049ec144d598b59ac3dc7edb15afa95a0b Mon Sep 17 00:00:00 2001 From: Samuel Poulton Date: Tue, 13 Aug 2024 15:37:22 -0600 Subject: [PATCH] Update tests to pass. --- .../FileSystemGraphObjectStore.test.ts | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/integration-sdk-runtime/src/storage/FileSystemGraphObjectStore/__tests__/FileSystemGraphObjectStore.test.ts b/packages/integration-sdk-runtime/src/storage/FileSystemGraphObjectStore/__tests__/FileSystemGraphObjectStore.test.ts index 254ada768..b7e43513e 100644 --- a/packages/integration-sdk-runtime/src/storage/FileSystemGraphObjectStore/__tests__/FileSystemGraphObjectStore.test.ts +++ b/packages/integration-sdk-runtime/src/storage/FileSystemGraphObjectStore/__tests__/FileSystemGraphObjectStore.test.ts @@ -514,7 +514,7 @@ describe('iterateEntities', () => { const nonMatchingEntities = times(25, () => createTestEntity({ _type: uuid() }), ); - const matchingEntities = times(25, () => + const matchingEntities = times(25000, () => createTestEntity({ _type: matchingType }), ); @@ -539,10 +539,10 @@ 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 () => { @@ -550,10 +550,10 @@ describe('iterateEntities', () => { 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 }), ); @@ -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 () => {