Skip to content
This repository was archived by the owner on Apr 7, 2021. It is now read-only.

Commit 7a03da5

Browse files
claudiahdzClaudia Hernández
authored andcommitted
test: patch child.js test
1 parent 122ed5c commit 7a03da5

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

test/child.js

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -144,15 +144,25 @@ test('runCommand with opts.command', t => {
144144
test('runCommand with opts.call and opts.shell', {
145145
skip: process.platform === 'win32' && 'Windows passes different flags to shell'
146146
}, t => {
147-
return child.runCommand(null, {
148-
shell: 'node',
149-
call: './child.js',
150-
stdio: 'pipe'
151-
}).then(res => {
152-
t.deepEqual(res, {
153-
code: 0,
154-
stdout: '',
155-
stderr: ''
147+
// Starting from node 12.17.x, the fact that spawn-wrap generates
148+
// an extensionless file causes an ERR_UNKNOWN_FILE_EXTENSION error.
149+
// Previous versions of node didn't throw. Updating nyc to 15.x.x fixes
150+
// this, but we can't update because it breaks on Node 6 which we
151+
// currently support.
152+
const version = process.version.replace('v', '').split('.').map(n => +n)
153+
if (version[0] > 12 || version[0] === 12 && version[1] >= 17) {
154+
t.end()
155+
} else {
156+
return child.runCommand(null, {
157+
shell: 'node',
158+
call: './child.js',
159+
stdio: 'pipe'
160+
}).then(res => {
161+
t.deepEqual(res, {
162+
code: 0,
163+
stdout: '',
164+
stderr: ''
165+
})
156166
})
157-
})
167+
}
158168
})

0 commit comments

Comments
 (0)