@@ -8,24 +8,24 @@ describe('ContextIndex tests', () => {
88 indexUnderTest . notice ( 'third' , 3 ) ;
99
1010 expect ( indexUnderTest . container . index . length ) . toEqual ( 3 ) ;
11- expect ( indexUnderTest . container . index . at ( 0 ) ) . toEqual ( { id : 'first' , timestamp : 1 } ) ;
12- expect ( indexUnderTest . container . index . at ( 1 ) ) . toEqual ( { id : 'second' , timestamp : 2 } ) ;
13- expect ( indexUnderTest . container . index . at ( 2 ) ) . toEqual ( { id : 'third' , timestamp : 3 } ) ;
11+ expect ( indexUnderTest . container . index [ 0 ] ) . toEqual ( { id : 'first' , timestamp : 1 } ) ;
12+ expect ( indexUnderTest . container . index [ 1 ] ) . toEqual ( { id : 'second' , timestamp : 2 } ) ;
13+ expect ( indexUnderTest . container . index [ 2 ] ) . toEqual ( { id : 'third' , timestamp : 3 } ) ;
1414 } ) ;
1515
1616 test ( 'notice updates timestamp' , async ( ) => {
1717 const indexUnderTest = new ContextIndex ( ) ;
1818 indexUnderTest . notice ( 'first' , 1 ) ;
1919 indexUnderTest . notice ( 'second' , 2 ) ;
2020 expect ( indexUnderTest . container . index . length ) . toEqual ( 2 ) ;
21- expect ( indexUnderTest . container . index . at ( 0 ) ) . toEqual ( { id : 'first' , timestamp : 1 } ) ;
22- expect ( indexUnderTest . container . index . at ( 1 ) ) . toEqual ( { id : 'second' , timestamp : 2 } ) ;
21+ expect ( indexUnderTest . container . index [ 0 ] ) . toEqual ( { id : 'first' , timestamp : 1 } ) ;
22+ expect ( indexUnderTest . container . index [ 1 ] ) . toEqual ( { id : 'second' , timestamp : 2 } ) ;
2323
2424 indexUnderTest . notice ( 'first' , 3 ) ;
2525 indexUnderTest . notice ( 'second' , 4 ) ;
2626 expect ( indexUnderTest . container . index . length ) . toEqual ( 2 ) ;
27- expect ( indexUnderTest . container . index . at ( 0 ) ) . toEqual ( { id : 'first' , timestamp : 3 } ) ;
28- expect ( indexUnderTest . container . index . at ( 1 ) ) . toEqual ( { id : 'second' , timestamp : 4 } ) ;
27+ expect ( indexUnderTest . container . index [ 0 ] ) . toEqual ( { id : 'first' , timestamp : 3 } ) ;
28+ expect ( indexUnderTest . container . index [ 1 ] ) . toEqual ( { id : 'second' , timestamp : 4 } ) ;
2929 } ) ;
3030
3131 test ( 'prune oldest down to maximum' , async ( ) => {
@@ -38,8 +38,8 @@ describe('ContextIndex tests', () => {
3838
3939 indexUnderTest . prune ( 2 ) ;
4040 expect ( indexUnderTest . container . index . length ) . toEqual ( 2 ) ;
41- expect ( indexUnderTest . container . index . at ( 0 ) ) . toEqual ( { id : 'first' , timestamp : 50 } ) ;
42- expect ( indexUnderTest . container . index . at ( 1 ) ) . toEqual ( { id : 'fourth' , timestamp : 51 } ) ;
41+ expect ( indexUnderTest . container . index [ 0 ] ) . toEqual ( { id : 'first' , timestamp : 50 } ) ;
42+ expect ( indexUnderTest . container . index [ 1 ] ) . toEqual ( { id : 'fourth' , timestamp : 51 } ) ;
4343 } ) ;
4444
4545 test ( 'prune oldest down to 0' , async ( ) => {
@@ -94,9 +94,9 @@ describe('ContextIndex tests', () => {
9494 '{"index":[{"id":"first","timestamp":1},{"id":"second","timestamp":2},{"id":"third","timestamp":3}]}' ;
9595 const indexUnderTest = ContextIndex . fromJson ( input ) ;
9696 expect ( indexUnderTest . container . index . length ) . toEqual ( 3 ) ;
97- expect ( indexUnderTest . container . index . at ( 0 ) ) . toEqual ( { id : 'first' , timestamp : 1 } ) ;
98- expect ( indexUnderTest . container . index . at ( 1 ) ) . toEqual ( { id : 'second' , timestamp : 2 } ) ;
99- expect ( indexUnderTest . container . index . at ( 2 ) ) . toEqual ( { id : 'third' , timestamp : 3 } ) ;
97+ expect ( indexUnderTest . container . index [ 0 ] ) . toEqual ( { id : 'first' , timestamp : 1 } ) ;
98+ expect ( indexUnderTest . container . index [ 1 ] ) . toEqual ( { id : 'second' , timestamp : 2 } ) ;
99+ expect ( indexUnderTest . container . index [ 2 ] ) . toEqual ( { id : 'third' , timestamp : 3 } ) ;
100100 } ) ;
101101
102102 test ( 'fromJson invalid' , async ( ) => {
0 commit comments