Skip to content

Commit 941e407

Browse files
Merge pull request #38 from blockfrost/fix-matchers
fix: matchers
2 parents eb5ebdd + dddf3b2 commit 941e407

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/matchers.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { expect } from 'vitest';
21
import { getUnixTime, isValid } from 'date-fns';
32
import { isBlockchainStateSetupEnabled } from './utils.js';
43
import { 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
};

0 commit comments

Comments
 (0)