@@ -25,7 +25,7 @@ const users1kRelated = Array.from(
2525 id : randUuid ( ) ,
2626 firstName : randFirstName ( ) ,
2727 appointmentId : randUuid ( ) ,
28- } ) as User
28+ } as User )
2929)
3030
3131const appointments1kRelated = users1kRelated . map (
@@ -35,7 +35,7 @@ const appointments1kRelated = users1kRelated.map(
3535 userId : user . id ,
3636 date : randFutureDate ( ) . getTime ( ) ,
3737 name : randBook ( ) . title ,
38- } ) as Appointment
38+ } as Appointment )
3939)
4040
4141// check the .cache directory for the generated data. If it doesn't exist, it will be generated. Need users1k.json, users10k.json, users10kRelated.json, appointments10kRelated.json
@@ -51,52 +51,40 @@ afterEach(() => {
5151} )
5252
5353describe ( 'Efficiency tests for ' , ( ) => {
54- // test('The speed of a plexus collection collecting more than a thousand randomly generated objects into multiple groups', () => {
55- // instance({ logLevel: 'debug' })
56- // console.log('Starting test...')
57- // console.log('items in collection:', users1k.length)
58- // usersLite.collect(users1k, ['firstNames'])
59- // console.log('items in collection:', usersLite.value.length)
60- // expect(usersLite.value.length).toBe(1000)
61- // expect(usersLite.groups.firstNames.value.length).toBe(1000)
62- // instance({ logLevel: undefined })
63- // })
64- // test('Testing the same as above but with an absurd amount of data', () => {
65- // instance({ logLevel: 'debug' })
66- // console.log('Starting test...')
67- // console.log('items in collection:', users10k.length)
68- // usersLite.collect(users10k, ['firstNames'])
69- // console.log('items in collection:', usersLite.value.length)
70- // // const group1 = collectionInstance.group('appointmentId')
71- // // const group2 = collectionInstance.group('name')
72- // // expect(group1.value.length).toBe(1000)
73- // // expect(group2.value.length).toBe(1000)
74- // instance({ logLevel: undefined })
75- // })
76- // test('An absurd amount of related data', () => {
77- // instance({ logLevel: 'debug' })
78- // console.log('Starting test...')
79- // console.log('items in collection:', users10k.length)
80- // users.collect(users1kRelated, ['main'])
81- // appointments.collect(appointments1kRelated, ['main'])
82- // console.log('items in collection:', users.value.length)
83- // // const group1 = collectionInstance.group('appointmentId')
84- // // const group2 = collectionInstance.group('name')
85- // // expect(group1.value.length).toBe(1000)
86- // // expect(group2.value.length).toBe(1000)
87- // instance({ logLevel: undefined })
88- // })
89- // test('An absurd amount of related data', () => {
90- // instance({ logLevel: 'debug' })
91- // console.log('Starting test...')
92- // console.log('items in collection:', users10k.length)
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- // })
54+ test ( 'The speed of a plexus collection collecting more than a thousand randomly generated objects into multiple groups' , ( ) => {
55+ instance ( { logLevel : 'debug' } )
56+ console . log ( 'Starting test...' )
57+ console . log ( 'items in collection:' , users1k . length )
58+ usersLite . collect ( users1k , [ 'firstNames' ] )
59+ console . log ( 'items in collection:' , usersLite . value . length )
60+ expect ( usersLite . value . length ) . toBe ( 1000 )
61+ expect ( usersLite . groups . firstNames . value . length ) . toBe ( 1000 )
62+
63+ instance ( { logLevel : undefined } )
64+ } )
65+ test ( 'Testing the same as above but with an absurd amount of data' , ( ) => {
66+ instance ( { logLevel : 'debug' } )
67+ console . log ( 'Starting test...' )
68+ console . log ( 'items in collection:' , users10k . length )
69+ usersLite . collect ( users10k , [ 'firstNames' ] )
70+ console . log ( 'items in collection:' , usersLite . value . length )
71+ // const group1 = collectionInstance.group('appointmentId')
72+ // const group2 = collectionInstance.group('name')
73+ // expect(group1.value.length).toBe(1000)
74+ // expect(group2.value.length).toBe(1000)
75+ instance ( { logLevel : undefined } )
76+ } )
77+ test ( 'An absurd amount of related data' , ( ) => {
78+ instance ( { logLevel : 'debug' } )
79+ console . log ( 'Starting test...' )
80+ console . log ( 'items in collection:' , users10k . length )
81+ users . collect ( users1kRelated , [ 'main' ] )
82+ appointments . collect ( appointments1kRelated , [ 'main' ] )
83+ console . log ( 'items in collection:' , users . 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+ } )
10290} )
0 commit comments