From 8cfc51af9ab27cd7b49b844bc0d4d149925fa879 Mon Sep 17 00:00:00 2001 From: William Durand Date: Tue, 27 May 2025 17:35:01 +0200 Subject: [PATCH 1/2] ci: bump node versions --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1eb503e87b..6152f33942 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -28,9 +28,9 @@ references: # See https://nodejs.org/en/about/previous-releases for updates to nodejs versions. nodejs_versions: # nvm-windows wants a full Node version, not just `.`. - - &nodejs_current "18.19.0" - - &nodejs_next "20.11.0" - - &nodejs_experimental "21.5" + - &nodejs_current "20.19.5" + - &nodejs_next "22.19" + - &nodejs_experimental "24.8" nodejs_enum: &nodejs_enum type: enum From f1a1c67307f7db34f333d3751b96ebe278083232 Mon Sep 17 00:00:00 2001 From: William Durand Date: Wed, 24 Sep 2025 12:26:16 +0200 Subject: [PATCH 2/2] Let mocha.bat be executed on windows --- scripts/lib/mocha.js | 2 ++ tests/functional/test.lib.imports.js | 13 +++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/scripts/lib/mocha.js b/scripts/lib/mocha.js index 25c6931769..fa79e8d32b 100644 --- a/scripts/lib/mocha.js +++ b/scripts/lib/mocha.js @@ -29,6 +29,8 @@ const runMocha = (args, execMochaOptions = {}, coverageEnabled) => { NODE_ENV: 'test', }, stdio: 'inherit', + // See: https://nodejs.org/api/child_process.html#spawning-bat-and-cmd-files-on-windows + shell: process.platform === 'win32', }); if (res.error) { diff --git a/tests/functional/test.lib.imports.js b/tests/functional/test.lib.imports.js index 6fbfcb9c68..40b494e7ed 100644 --- a/tests/functional/test.lib.imports.js +++ b/tests/functional/test.lib.imports.js @@ -7,7 +7,10 @@ import shell from 'shelljs'; import { withTempDir, fixturesUseAsLibrary } from './common.js'; -const npm = shell.which('npm')?.toString(); +let npm = shell.which('npm')?.toString(); +if (process.platform === 'win32') { + npm = `"${npm}"`; +} const node = shell.which('node')?.toString(); const dirname = path.dirname(fileURLToPath(import.meta.url || '')); @@ -29,6 +32,8 @@ describe('web-ext imported as a library', () => { execFileSync(npm, ['install', packageDir], { cwd: tmpDir.path(), stdio: 'inherit', + // See: https://nodejs.org/api/child_process.html#spawning-bat-and-cmd-files-on-windows + shell: process.platform === 'win32', }); shell.cp('-rf', `${fixturesUseAsLibrary}/*`, tmpDir.path()); execFileSync(node, ['--experimental-modules', 'test-import.mjs'], { @@ -39,7 +44,11 @@ describe('web-ext imported as a library', () => { it('can be imported as a CommonJS module', async () => { await withTempDir(async (tmpDir) => { - execFileSync(npm, ['install', packageDir], { cwd: tmpDir.path() }); + execFileSync(npm, ['install', packageDir], { + cwd: tmpDir.path(), + // See: https://nodejs.org/api/child_process.html#spawning-bat-and-cmd-files-on-windows + shell: process.platform === 'win32', + }); shell.cp('-rf', `${fixturesUseAsLibrary}/*`, tmpDir.path()); execFileSync(node, ['--experimental-modules', 'test-require.js'], { cwd: tmpDir.path(),