diff --git a/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-2.js b/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-2.js index db007a53a44f3b..751c864bace06a 100644 --- a/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-2.js +++ b/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-2.js @@ -26,4 +26,4 @@ if (!binding.ensureAllocation(2 * kStringMaxLength)) common.skip(skipMessage); const maxString = buf.toString('utf16le'); -assert.strictEqual(maxString.length, (kStringMaxLength + 2) / 2); +assert.strictEqual(maxString.length, Math.floor((kStringMaxLength + 2) / 2));