@@ -22,7 +22,9 @@ require('npmlog').level = 'warn'
2222const checks = [
2323 { path : process . env . PYTHON , name : 'env var PYTHON' } ,
2424 { path : process . env . python2 , name : 'env var python2' } ,
25- { path : 'python3' , name : 'env var python3' }
25+ { path : 'python3' , name : 'python3 in PATH' } ,
26+ { path : 'python2' , name : 'python2 in PATH' } ,
27+ { path : 'python' , name : 'pyhton in PATH' }
2628]
2729const args = [ path . resolve ( './lib/find-python-script.py' ) ]
2830const options = {
@@ -45,22 +47,21 @@ const options = {
4547function check ( err , stdout , stderr ) {
4648 const { t, exec } = this
4749 if ( ! err && ! stderr ) {
48- t . strictEqual (
50+ t . true (
4951 stdout . trim ( ) ,
50- exec . path ,
5152 `${ exec . name } : check path ${ exec . path } equals ${ stdout . trim ( ) } `
5253 )
5354 } else {
5455 // @ts -ignore
55- if ( err . code === 9009 ) {
56+ if ( err . code === 9009 || err . code === 'ENOENT' ) {
5657 t . skip ( `skipped: ${ exec . name } file not found` )
5758 } else {
58- t . fail ( `error: ${ err } \n\nstderr: ${ stderr } ` )
59+ t . skip ( `error: ${ err } \n\nstderr: ${ stderr } ` )
5960 }
6061 }
6162}
6263
63- test ( 'find-python-script' , ( t ) => {
64+ test ( 'find-python-script' , { buffered : false } , ( t ) => {
6465 t . plan ( checks . length )
6566
6667 // context for check functions
0 commit comments