Skip to content

Commit c95fab9

Browse files
committed
fix: matchers
1 parent 163c48a commit c95fab9

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/matchers.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,8 @@ export const toBeEpochSlotNumber = (received: number) => {
227227

228228
const max = globalThis.latest.block.epoch_slot! + buffer;
229229

230-
expect(received).toBeInRange(min, max);
231230
return {
232-
pass: true,
231+
pass: typeof received === 'number' && toBeInRange.toBe(received, min, max).pass,
233232
message: () => `Expected value ${received} to be within range for an epoch <${min}, ${max}>`,
234233
};
235234
};
@@ -246,9 +245,8 @@ export const toBeSlotNumber = (received: number) => {
246245

247246
const max = globalThis.latest.block.slot!; // Note: this could be improved to match interval for given network
248247

249-
expect(received).toBeInRange(min, max + 150);
250248
return {
251-
pass: true,
249+
pass: typeof received === 'number' && toBeInRange.toBe(received, min, max + 150).pass,
252250
message: () => `Expected value ${received} to be within range for a slot <${min}, ${max}>`,
253251
};
254252
};

0 commit comments

Comments
 (0)