Skip to content

Commit d967ed8

Browse files
authored
ci: bump node versions (#3428)
FTR `shell` needs to be set to `true` since https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2, because it refuses to load `.bat` files on Windows otherwise.
1 parent 3679c7c commit d967ed8

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

.circleci/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ references:
2828
# See https://nodejs.org/en/about/previous-releases for updates to nodejs versions.
2929
nodejs_versions:
3030
# nvm-windows wants a full Node version, not just `<major>.<minor>`.
31-
- &nodejs_current "18.19.0"
32-
- &nodejs_next "20.11.0"
33-
- &nodejs_experimental "21.5"
31+
- &nodejs_current "20.19.5"
32+
- &nodejs_next "22.19"
33+
- &nodejs_experimental "24.8"
3434

3535
nodejs_enum: &nodejs_enum
3636
type: enum

scripts/lib/mocha.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ const runMocha = (args, execMochaOptions = {}, coverageEnabled) => {
2929
NODE_ENV: 'test',
3030
},
3131
stdio: 'inherit',
32+
// See: https://nodejs.org/api/child_process.html#spawning-bat-and-cmd-files-on-windows
33+
shell: process.platform === 'win32',
3234
});
3335

3436
if (res.error) {

tests/functional/test.lib.imports.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ import shell from 'shelljs';
77

88
import { withTempDir, fixturesUseAsLibrary } from './common.js';
99

10-
const npm = shell.which('npm')?.toString();
10+
let npm = shell.which('npm')?.toString();
11+
if (process.platform === 'win32') {
12+
npm = `"${npm}"`;
13+
}
1114
const node = shell.which('node')?.toString();
1215

1316
const dirname = path.dirname(fileURLToPath(import.meta.url || ''));
@@ -29,6 +32,8 @@ describe('web-ext imported as a library', () => {
2932
execFileSync(npm, ['install', packageDir], {
3033
cwd: tmpDir.path(),
3134
stdio: 'inherit',
35+
// See: https://nodejs.org/api/child_process.html#spawning-bat-and-cmd-files-on-windows
36+
shell: process.platform === 'win32',
3237
});
3338
shell.cp('-rf', `${fixturesUseAsLibrary}/*`, tmpDir.path());
3439
execFileSync(node, ['--experimental-modules', 'test-import.mjs'], {
@@ -39,7 +44,11 @@ describe('web-ext imported as a library', () => {
3944

4045
it('can be imported as a CommonJS module', async () => {
4146
await withTempDir(async (tmpDir) => {
42-
execFileSync(npm, ['install', packageDir], { cwd: tmpDir.path() });
47+
execFileSync(npm, ['install', packageDir], {
48+
cwd: tmpDir.path(),
49+
// See: https://nodejs.org/api/child_process.html#spawning-bat-and-cmd-files-on-windows
50+
shell: process.platform === 'win32',
51+
});
4352
shell.cp('-rf', `${fixturesUseAsLibrary}/*`, tmpDir.path());
4453
execFileSync(node, ['--experimental-modules', 'test-require.js'], {
4554
cwd: tmpDir.path(),

0 commit comments

Comments
 (0)