File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed
Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change 1- import { expect } from 'vitest' ;
21import { getUnixTime , isValid } from 'date-fns' ;
32import { isBlockchainStateSetupEnabled } from './utils.js' ;
43import { getConfig } from './config.js' ;
@@ -227,9 +226,8 @@ export const toBeEpochSlotNumber = (received: number) => {
227226
228227 const max = globalThis . latest . block . epoch_slot ! + buffer ;
229228
230- expect ( received ) . toBeInRange ( min , max ) ;
231229 return {
232- pass : true ,
230+ pass : typeof received === 'number' && toBeInRange . toBe ( received , min , max ) . pass ,
233231 message : ( ) => `Expected value ${ received } to be within range for an epoch <${ min } , ${ max } >` ,
234232 } ;
235233} ;
@@ -246,9 +244,8 @@ export const toBeSlotNumber = (received: number) => {
246244
247245 const max = globalThis . latest . block . slot ! ; // Note: this could be improved to match interval for given network
248246
249- expect ( received ) . toBeInRange ( min , max + 150 ) ;
250247 return {
251- pass : true ,
248+ pass : typeof received === 'number' && toBeInRange . toBe ( received , min , max + 150 ) . pass ,
252249 message : ( ) => `Expected value ${ received } to be within range for a slot <${ min } , ${ max } >` ,
253250 } ;
254251} ;
You can’t perform that action at this time.
0 commit comments