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: https://github.com/nodejs/node/pull/24566 Refs: https://github.com/nodejs/node/issues/24565 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
This commit is contained in:
parent
80671dc1f9
commit
b303d8bb21
@ -7,6 +7,7 @@ const promiseFs = require('fs').promises;
|
||||
const path = require('path');
|
||||
const tmpdir = require('../common/tmpdir');
|
||||
const { isDate } = require('util').types;
|
||||
const { inspect } = require('util');
|
||||
|
||||
tmpdir.refresh();
|
||||
|
||||
@ -62,7 +63,11 @@ function verifyStats(bigintStats, numStats) {
|
||||
assert.strictEqual(bigintStats[key], undefined);
|
||||
assert.strictEqual(numStats[key], undefined);
|
||||
} else if (Number.isSafeInteger(val)) {
|
||||
assert.strictEqual(bigintStats[key], BigInt(val));
|
||||
assert.strictEqual(
|
||||
bigintStats[key], BigInt(val),
|
||||
`${inspect(bigintStats[key])} !== ${inspect(BigInt(val))}\n` +
|
||||
`key=${key}, val=${val}`
|
||||
);
|
||||
} else {
|
||||
assert(
|
||||
Math.abs(Number(bigintStats[key]) - val) < 1,
|
||||
|
Loading…
x
Reference in New Issue
Block a user