From 007e2855af029cdfbabb993eb0667053ed010eae Mon Sep 17 00:00:00 2001 From: Darshan Sen Date: Thu, 13 May 2021 21:13:23 +0530 Subject: [PATCH] test: use error code mapping in place of raw errno Refs: https://github.com/nodejs/node/pull/38159#discussion_r610288214 PR-URL: https://github.com/nodejs/node/pull/38675 Reviewed-By: Anna Henningsen Reviewed-By: Richard Lau Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Trivikram Kamat --- test/parallel/test-fs-read-type.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-fs-read-type.js b/test/parallel/test-fs-read-type.js index 2baab18dc9f483..81ad7ecbbe9043 100644 --- a/test/parallel/test-fs-read-type.js +++ b/test/parallel/test-fs-read-type.js @@ -117,7 +117,7 @@ fs.read(fd, common.mustCall((err) => { if (err) { if (common.isIBMi) - assert.strictEqual(err.errno, -127); + assert.strictEqual(err.code, 'EOVERFLOW'); else assert.strictEqual(err.code, 'EFBIG'); } @@ -238,6 +238,6 @@ try { // On systems where max file size is below 2^53-1, we'd expect a EFBIG error. // This is not using `assert.throws` because the above call should not raise // any error on systems that allows file of that size. - if (err.code !== 'EFBIG' && !(common.isIBMi && err.errno === -127)) + if (err.code !== 'EFBIG' && !(common.isIBMi && err.code === 'EOVERFLOW')) throw err; }