File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
packages/core/src/analytics/__tests__ Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -115,11 +115,15 @@ describe(getDelay, () => {
115115 it ( 'should calculate the amount of time to delay before invoking the callback' , ( ) => {
116116 const aShortTimeAgo = Date . now ( ) - 200
117117 const timeout = 5000
118- expect ( Math . round ( getDelay ( aShortTimeAgo , timeout ) ) ) . toBe ( 4800 )
118+ const result = getDelay ( aShortTimeAgo , timeout )
119+ expect ( result ) . toBeLessThanOrEqual ( 4800 )
120+ expect ( result ) . toBeGreaterThanOrEqual ( 4790 )
119121 } )
120122
121123 it ( 'should have a sensible default' , ( ) => {
122124 const aShortTimeAgo = Date . now ( ) - 200
123- expect ( Math . round ( getDelay ( aShortTimeAgo ) ) ) . toBe ( 100 )
125+ const result = getDelay ( aShortTimeAgo )
126+ expect ( result ) . toBeLessThanOrEqual ( 100 )
127+ expect ( result ) . toBeGreaterThanOrEqual ( 90 )
124128 } )
125129} )
You can’t perform that action at this time.
0 commit comments