Skip to content

Commit 765a81e

Browse files
Trottrvagg
authored andcommitted
test: add information to assertion
test-fs-stat-bigint.js failed once in CI but there wasn't enough information to know what was giong on. Adding a bit of information to the assertion that failed in case it fails again. PR-URL: #24566 Refs: #24565 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
1 parent 759ed86 commit 765a81e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/parallel/test-fs-stat-bigint.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const promiseFs = require('fs').promises;
77
const path = require('path');
88
const tmpdir = require('../common/tmpdir');
99
const { isDate } = require('util').types;
10+
const { inspect } = require('util');
1011

1112
tmpdir.refresh();
1213

@@ -62,7 +63,11 @@ function verifyStats(bigintStats, numStats) {
6263
assert.strictEqual(bigintStats[key], undefined);
6364
assert.strictEqual(numStats[key], undefined);
6465
} else if (Number.isSafeInteger(val)) {
65-
assert.strictEqual(bigintStats[key], BigInt(val));
66+
assert.strictEqual(
67+
bigintStats[key], BigInt(val),
68+
`${inspect(bigintStats[key])} !== ${inspect(BigInt(val))}\n` +
69+
`key=${key}, val=${val}`
70+
);
6671
} else {
6772
assert(
6873
Math.abs(Number(bigintStats[key]) - val) < 1,

0 commit comments

Comments
 (0)