@@ -12,26 +12,50 @@ test('should get FPS', () => {
1212 expect ( result ) . toMatchSnapshot ( )
1313} )
1414
15- test ( 'should get summary data' , ( ) => {
15+ test ( 'getSummary: should get summary data' , ( ) => {
1616 const trace = new Tracelib ( JANK_TRACE_LOG )
1717 const result = trace . getSummary ( )
1818 expect ( result ) . toMatchSnapshot ( )
1919} )
2020
21+ test ( 'getSummary: should throw error if main track is missing' , ( ) => {
22+ const trace = new Tracelib ( [ ] )
23+ expect ( ( ) => trace . getSummary ( ) )
24+ . toThrow ( new Error ( 'MainTrack is missing in traceLog' ) )
25+ } )
26+
2127test ( 'should get summary data between passed range' , ( ) => {
2228 const trace = new Tracelib ( JANK_TRACE_LOG )
2329 const result = trace . getSummary ( 289960055.634 , 289960729.717 )
2430 expect ( result ) . toMatchSnapshot ( )
2531} )
2632
27- test ( 'should get warning counts' , ( ) => {
33+ test ( 'getWarningCounts: should get warning counts' , ( ) => {
2834 const trace = new Tracelib ( JANK_TRACE_LOG )
2935 const result = trace . getWarningCounts ( )
3036 expect ( result ) . toMatchSnapshot ( )
3137} )
3238
39+ test ( 'getWarningCounts: should throw error if main track is missing' , ( ) => {
40+ const trace = new Tracelib ( [ ] )
41+ expect ( ( ) => trace . getWarningCounts ( ) )
42+ . toThrow ( new Error ( 'MainTrack is missing in traceLog' ) )
43+ } )
44+
3345test ( 'should get memory counters' , ( ) => {
3446 const trace = new Tracelib ( JANK_TRACE_LOG )
3547 const result = trace . getMemoryCounters ( )
3648 expect ( result ) . toMatchSnapshot ( )
3749} )
50+
51+ test ( 'mainTrackEvents: should get events' , ( ) => {
52+ const trace = new Tracelib ( JANK_TRACE_LOG )
53+ const result = trace . getMainTrackEvents ( )
54+ expect ( result . length ) . toEqual ( 56244 )
55+ } )
56+
57+ test ( 'mainTrackEvents: should throws error if main track is missing' , ( ) => {
58+ const trace = new Tracelib ( [ ] )
59+ expect ( ( ) => trace . getMainTrackEvents ( ) )
60+ . toThrow ( new Error ( 'MainTrack is missing in traceLog' ) )
61+ } )
0 commit comments