From e747896f3fccba008cfc1b16f4aa3ee5ae07a3d7 Mon Sep 17 00:00:00 2001 From: Vladimir Morozov Date: Sun, 30 Jun 2024 14:20:25 -0700 Subject: [PATCH] test: fix embedding test for Windows --- test/common/child_process.js | 4 ++++ test/embedding/test-embedding.js | 6 ------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/test/common/child_process.js b/test/common/child_process.js index d555d09a944c1c..192accd4d4f82a 100644 --- a/test/common/child_process.js +++ b/test/common/child_process.js @@ -3,6 +3,7 @@ const assert = require('assert'); const { spawnSync, execFileSync } = require('child_process'); const common = require('./'); +const os = require('os'); const util = require('util'); // Workaround for Windows Server 2008R2 @@ -43,6 +44,9 @@ function logAfterTime(time) { } function checkOutput(str, check) { + if (common.isWindows && typeof str === 'string') { + str = str.replaceAll(os.EOL, '\n'); + } if ((check instanceof RegExp && !check.test(str)) || (typeof check === 'string' && check !== str)) { return { passed: false, reason: `did not match ${util.inspect(check)}` }; diff --git a/test/embedding/test-embedding.js b/test/embedding/test-embedding.js index 5f706eb5666dd0..1a579a11edc8b6 100644 --- a/test/embedding/test-embedding.js +++ b/test/embedding/test-embedding.js @@ -152,12 +152,6 @@ for (const extraSnapshotArgs of [ { cwd: tmpdir.path }); } -// Skipping rest of the test on Windows because it fails in the CI -// TODO(StefanStojanovic): Reenable rest of the test after fixing it -if (common.isWindows) { - return; -} - // Guarantee NODE_REPL_EXTERNAL_MODULE won't bypass kDisableNodeOptionsEnv { spawnSyncAndExit(