Skip to content

Commit d33b40a

Browse files
committed
Add Node.js 20 and fix Windows failure
Node.js 18+ failed on Windows due to upstream restriction on spawning `.cmd`. Make this pass and add Node.js 20 to CI going forward.
1 parent 268931b commit d33b40a

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
node: [10, 12, 14]
16+
node: [10, 12, 14, 20]
1717
os: [ubuntu-latest, windows-latest]
1818

1919
steps:

test/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@ exports['util.spawn'] = {
182182
var win32 = process.platform === 'win32';
183183
util.spawn({
184184
cmd: 'test\\fixtures\\exec' + (win32 ? '.cmd' : '.sh'),
185+
// Fix Node.js 18+ on Windows, https://github.com/nodejs/node/issues/52554
186+
opts: { shell: true }
185187
}, function(err, result, code) {
186188
test.equals(err, null);
187189
test.equals(code, 0);
@@ -197,7 +199,11 @@ exports['util.spawn'] = {
197199
var win32 = process.platform === 'win32';
198200
util.spawn({
199201
cmd: './exec' + (win32 ? '.cmd' : '.sh'),
200-
opts: {cwd: 'test/fixtures'},
202+
opts: {
203+
cwd: 'test/fixtures',
204+
// Fix Node.js 18+ on Windows, https://github.com/nodejs/node/issues/52554
205+
shell: true
206+
},
201207
}, function(err, result, code) {
202208
test.equals(err, null);
203209
test.equals(code, 0);

0 commit comments

Comments
 (0)