diff --git a/test/es-module/test-esm-export-not-found.mjs b/test/es-module/test-esm-export-not-found.mjs index 1dc44e2bbac97a..0df42fba0532c7 100644 --- a/test/es-module/test-esm-export-not-found.mjs +++ b/test/es-module/test-esm-export-not-found.mjs @@ -25,7 +25,7 @@ const importStatementMultiline = `import { let stderr = ''; child.stderr.setEncoding('utf8'); child.stderr.on('data', (data) => { - stderr += data; + stderr += data.toString(); }); child.on('close', () => { // SyntaxError: The requested module './module-named-exports.mjs' diff --git a/test/es-module/test-esm-import-json-named-export.mjs b/test/es-module/test-esm-import-json-named-export.mjs index 73e8e9184972b4..649adea4a736af 100644 --- a/test/es-module/test-esm-import-json-named-export.mjs +++ b/test/es-module/test-esm-import-json-named-export.mjs @@ -12,7 +12,7 @@ const child = spawn(execPath, [ let stderr = ''; child.stderr.setEncoding('utf8'); child.stderr.on('data', (data) => { - stderr += data; + stderr += data.toString(); }); child.on('close', () => { // SyntaxError: The requested module '../experimental.json' diff --git a/test/es-module/test-esm-loader-not-found.mjs b/test/es-module/test-esm-loader-not-found.mjs index 545127eb2412aa..e86e867696c99c 100644 --- a/test/es-module/test-esm-loader-not-found.mjs +++ b/test/es-module/test-esm-loader-not-found.mjs @@ -13,7 +13,7 @@ const child = spawn(execPath, [ let stderr = ''; child.stderr.setEncoding('utf8'); child.stderr.on('data', (data) => { - stderr += data; + stderr += data.toString(); }); child.on('close', () => { // Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'i-dont-exist' diff --git a/test/es-module/test-esm-loader-obsolete-hooks.mjs b/test/es-module/test-esm-loader-obsolete-hooks.mjs index a64456bdbe0a97..d297624d9d1981 100644 --- a/test/es-module/test-esm-loader-obsolete-hooks.mjs +++ b/test/es-module/test-esm-loader-obsolete-hooks.mjs @@ -15,7 +15,7 @@ const child = spawn(execPath, [ let stderr = ''; child.stderr.setEncoding('utf8'); child.stderr.on('data', (data) => { - stderr += data; + stderr += data.toString(); }); child.on('close', () => { ok(stderr.includes( diff --git a/test/es-module/test-esm-loader-with-syntax-error.mjs b/test/es-module/test-esm-loader-with-syntax-error.mjs index d8ad0b5db27687..5305ae3b19be27 100644 --- a/test/es-module/test-esm-loader-with-syntax-error.mjs +++ b/test/es-module/test-esm-loader-with-syntax-error.mjs @@ -13,7 +13,7 @@ const child = spawn(execPath, [ let stderr = ''; child.stderr.setEncoding('utf8'); child.stderr.on('data', (data) => { - stderr += data; + stderr += data.toString(); }); child.on('close', () => { ok(stderr.includes('SyntaxError:')); diff --git a/test/es-module/test-esm-module-not-found-commonjs-hint.mjs b/test/es-module/test-esm-module-not-found-commonjs-hint.mjs index ffe26b6980ffbd..a9452b67e6ec5a 100644 --- a/test/es-module/test-esm-module-not-found-commonjs-hint.mjs +++ b/test/es-module/test-esm-module-not-found-commonjs-hint.mjs @@ -26,7 +26,7 @@ import { execPath } from 'process'; let stderr = ''; child.stderr.setEncoding('utf8'); child.stderr.on('data', (data) => { - stderr += data; + stderr += data.toString(); }); child.on('close', () => { ok(stderr.includes(expected)); diff --git a/test/es-module/test-esm-syntax-error.mjs b/test/es-module/test-esm-syntax-error.mjs index a40aba09d845b5..b8635c176288fa 100644 --- a/test/es-module/test-esm-syntax-error.mjs +++ b/test/es-module/test-esm-syntax-error.mjs @@ -11,7 +11,7 @@ const child = spawn(execPath, [ let stderr = ''; child.stderr.setEncoding('utf8'); child.stderr.on('data', (data) => { - stderr += data; + stderr += data.toString(); }); child.on('close', () => { ok(stderr.includes('SyntaxError:'));