diff options
author | Rich Trott <rtrott@gmail.com> | 2018-11-22 03:33:05 -0800 |
---|---|---|
committer | Daniel Bevenius <daniel.bevenius@gmail.com> | 2018-11-23 07:36:53 +0100 |
commit | b303d8bb21a6636555df9c5d41824071fd6c109b (patch) | |
tree | f0569ecce322a6f179e0994993abd56040c29ba6 /test | |
parent | 80671dc1f95a1256597a163b14b5c30df9042255 (diff) | |
download | node-new-b303d8bb21a6636555df9c5d41824071fd6c109b.tar.gz |
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>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-fs-stat-bigint.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/parallel/test-fs-stat-bigint.js b/test/parallel/test-fs-stat-bigint.js index 4691b2dd9d..e5c21138a2 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, |