This repository was archived by the owner on Apr 7, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +20
-10
lines changed Expand file tree Collapse file tree 1 file changed +20
-10
lines changed Original file line number Diff line number Diff line change @@ -144,15 +144,25 @@ test('runCommand with opts.command', t => {
144144test ( '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} )
You can’t perform that action at this time.
0 commit comments