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

Commit

Permalink
test: patch child.js test
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiahdz authored and Claudia Hernández committed Jul 20, 2020
1 parent 122ed5c commit 7a03da5
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions test/child.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,25 @@ test('runCommand with opts.command', t => {
test('runCommand with opts.call and opts.shell', {
skip: process.platform === 'win32' && 'Windows passes different flags to shell'
}, t => {
return child.runCommand(null, {
shell: 'node',
call: './child.js',
stdio: 'pipe'
}).then(res => {
t.deepEqual(res, {
code: 0,
stdout: '',
stderr: ''
// Starting from node 12.17.x, the fact that spawn-wrap generates
// an extensionless file causes an ERR_UNKNOWN_FILE_EXTENSION error.
// Previous versions of node didn't throw. Updating nyc to 15.x.x fixes
// this, but we can't update because it breaks on Node 6 which we
// currently support.
const version = process.version.replace('v', '').split('.').map(n => +n)
if (version[0] > 12 || version[0] === 12 && version[1] >= 17) {
t.end()
} else {
return child.runCommand(null, {
shell: 'node',
call: './child.js',
stdio: 'pipe'
}).then(res => {
t.deepEqual(res, {
code: 0,
stdout: '',
stderr: ''
})
})
})
}
})

0 comments on commit 7a03da5

Please sign in to comment.