@@ -56,42 +56,47 @@ afterEach(() => {
5656 appointments . clear ( )
5757} )
5858
59+ const LG_SIZE = 5000
60+ const MD_SIZE = 1000
61+ const SM_SIZE = 100
62+
5963describe ( 'Efficiency tests for ' , ( ) => {
6064 test ( 'The speed of a plexus collection collecting more than a thousand randomly generated objects into multiple groups' , ( ) => {
6165 instance ( { logLevel : 'debug' } )
6266 console . log ( 'Starting test...' )
63- console . log ( `${ users1k . length } items being pulled into collection` )
64- usersLite . collect ( users1k . slice ( 0 , 30 ) , [ 'firstNames' ] )
67+ const data = users10k . slice ( 0 , MD_SIZE )
68+ console . log ( `${ data . length } items being pulled into collection` )
69+ usersLite . collect ( data . slice ( 0 , MD_SIZE ) , [ 'firstNames' ] )
6570 // expect(usersLite.size).toBe(1000)
6671 console . log ( 'items in collection:' , usersLite . size )
67- expect ( usersLite . size ) . toBe ( 1000 )
68- // expect(usersLite.value.length).toBe(1000 )
69- // expect(usersLite.groups.firstNames.value.length).toBe(1000 )
72+ expect ( usersLite . size ) . toBe ( MD_SIZE )
73+ expect ( usersLite . value . length ) . toBe ( MD_SIZE )
74+ expect ( usersLite . groups . firstNames . value . length ) . toBe ( MD_SIZE )
7075 instance ( { logLevel : undefined } )
7176 } )
72- // test('Testing the same as above but with an absurd amount of data', () => {
73- // // instance({ logLevel: 'debug' })
74- // console.log('Starting test...')
75- // console.log('items in collection:', users10k.length )
76- // usersLite.collect(users10k, ['firstNames'] )
77- // console.log('items in collection:', usersLite.value.length )
78- // // const group1 = collectionInstance.group('appointmentId' )
79- // // const group2 = collectionInstance.group('name ')
80- // // expect(group1.value.length).toBe(1000 )
81- // // expect(group2 .value.length).toBe(1000)
82- // // instance({ logLevel: undefined } )
83- // })
84- // test('An absurd amount of related data', () => {
85- // // instance({ logLevel: 'debug' })
86- // console.log('Starting test...' )
87- // console.log('items in collection:', users10k.length )
88- // users.collect(users1kRelated, ['main'])
89- // appointments.collect(appointments1kRelated, ['main'])
90- // console.log('items in collection:', users.value.length)
91- // // const group1 = collectionInstance.group('appointmentId')
92- // // const group2 = collectionInstance.group('name')
93- // // expect(group1.value.length).toBe(1000)
94- // // expect(group2.value.length).toBe(1000)
95- // // instance({ logLevel: undefined })
96- // })
77+ test ( 'Testing the same as above but with an absurd amount of data' , ( ) => {
78+ // instance({ logLevel: 'debug' })
79+ console . log ( 'Starting test...' )
80+ const data = users10k . slice ( 0 , LG_SIZE )
81+ console . log ( 'items in collection:' , data . length )
82+ usersLite . collect ( data . slice ( 0 , LG_SIZE ) , [ 'firstNames' ] )
83+ console . log ( 'items in collection:' , usersLite . value . length )
84+ // const group1 = collectionInstance.group('appointmentId ')
85+ // const group2 = collectionInstance.group('name' )
86+ // expect(group1 .value.length).toBe(1000)
87+ // expect(group2.value.length).toBe(1000 )
88+ // instance({ logLevel: undefined })
89+ } )
90+ test ( 'An absurd amount of related data' , ( ) => {
91+ // instance({ logLevel: 'debug' } )
92+ console . log ( 'Starting test...' )
93+ users . collect ( users1kRelated , [ 'main' ] )
94+ appointments . collect ( appointments1kRelated , [ 'main' ] )
95+ console . log ( 'items in collection:' , users . value . length )
96+ // const group1 = collectionInstance.group('appointmentId')
97+ // const group2 = collectionInstance.group('name')
98+ // expect(group1.value.length).toBe(1000)
99+ // expect(group2.value.length).toBe(1000)
100+ // instance({ logLevel: undefined })
101+ } )
97102} )
0 commit comments