From 67adfdf9d9f46e752e39f3f3b7ebba516abac722 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Thu, 22 Nov 2018 03:33:05 -0800 Subject: [PATCH] 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 Reviewed-By: Daniel Bevenius --- test/parallel/test-fs-stat-bigint.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-fs-stat-bigint.js b/test/parallel/test-fs-stat-bigint.js index 4691b2dd9d267e..e5c21138a2ffe4 100644 --- a/test/parallel/test-fs-stat-bigint.js +++ b/test/parallel/test-fs-stat-bigint.js @@ -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,