@@ -82,6 +82,7 @@ describe('report implementation', () => {
82
82
it ( 'should set Max Latency to 2DP if available' , ( ) => {
83
83
const report = new Report ( ) ;
84
84
const txnStats = new TransactionStatisticsCollector ( ) ;
85
+ txnStats . stats . txCounters . totalSuccessful = 100 ;
85
86
txnStats . stats . latency . successful . max = 1232.2 ;
86
87
87
88
const output = report . getResultValues ( 'myTestLabel' , txnStats ) ;
@@ -91,18 +92,21 @@ describe('report implementation', () => {
91
92
it ( 'should set Min Latency to 2DP if available' , ( ) => {
92
93
const report = new Report ( ) ;
93
94
const txnStats = new TransactionStatisticsCollector ( ) ;
95
+ txnStats . stats . txCounters . totalSuccessful = 100 ;
94
96
txnStats . stats . latency . successful . min = 232.2 ;
95
97
96
98
const output = report . getResultValues ( 'myTestLabel' , txnStats ) ;
97
99
output . get ( 'Min Latency (s)' ) . should . equal ( '0.23' ) ;
98
100
} ) ;
99
101
100
- it ( 'should set Avg Latency to `-` if no successful transactions' , ( ) => {
102
+ it ( 'should set Min/Max/ Avg Latency to `-` if no successful transactions' , ( ) => {
101
103
const report = new Report ( ) ;
102
104
const txnStats = new TransactionStatisticsCollector ( ) ;
103
-
105
+ txnStats . stats . txCounters . totalSuccessful = 0 ;
104
106
const output = report . getResultValues ( 'myTestLabel' , txnStats ) ;
105
107
output . get ( 'Avg Latency (s)' ) . should . equal ( '-' ) ;
108
+ output . get ( 'Min Latency (s)' ) . should . equal ( '-' ) ;
109
+ output . get ( 'Max Latency (s)' ) . should . equal ( '-' ) ;
106
110
} ) ;
107
111
108
112
it ( 'should set Avg Latency to 2DP if available' , ( ) => {
0 commit comments