@@ -7,6 +7,7 @@ import {execa, execaSync, execaNode} from '../../index.js';
77import { FIXTURES_DIRECTORY } from '../helpers/fixtures-directory.js' ;
88import { identity , fullStdio } from '../helpers/stdio.js' ;
99import { foobarString } from '../helpers/input.js' ;
10+ import { getDenoNodePath } from '../helpers/file-path.js' ;
1011
1112process . chdir ( FIXTURES_DIRECTORY ) ;
1213
@@ -73,6 +74,9 @@ test('Cannot use "node" as binary - "node" option sync', testDoubleNode, 'node',
7374test ( 'Cannot use path to "node" as binary - execaNode()' , testDoubleNode , process . execPath , execaNode ) ;
7475test ( 'Cannot use path to "node" as binary - "node" option' , testDoubleNode , process . execPath , runWithNodeOption ) ;
7576test ( 'Cannot use path to "node" as binary - "node" option sync' , testDoubleNode , process . execPath , runWithNodeOptionSync ) ;
77+ test ( 'Cannot use deno style nodePath as binary - execaNode()' , testDoubleNode , getDenoNodePath ( ) , execaNode ) ;
78+ test ( 'Cannot use deno style nodePath as binary - "node" option' , testDoubleNode , getDenoNodePath ( ) , runWithNodeOption ) ;
79+ test ( 'Cannot use deno style nodePath as binary - "node" option sync' , testDoubleNode , getDenoNodePath ( ) , runWithNodeOptionSync ) ;
7680
7781const getNodePath = async ( ) => {
7882 const { path} = await getNode ( TEST_NODE_VERSION ) ;
@@ -174,6 +178,16 @@ test.serial('The "nodePath" option is relative to "cwd" - execaNode()', testCwdN
174178test . serial ( 'The "nodePath" option is relative to "cwd" - "node" option' , testCwdNodePath , runWithNodeOption ) ;
175179test . serial ( 'The "nodePath" option is relative to "cwd" - "node" option sync' , testCwdNodePath , runWithNodeOptionSync ) ;
176180
181+ const testDenoExecPath = async ( t , execaMethod ) => {
182+ const { exitCode, stdout} = await execaMethod ( 'noop.js' , [ ] , { nodePath : getDenoNodePath ( ) } ) ;
183+ t . is ( exitCode , 0 ) ;
184+ t . is ( stdout , foobarString ) ;
185+ } ;
186+
187+ test ( 'The deno style "nodePath" option can be used - execaNode()' , testDenoExecPath , execaNode ) ;
188+ test ( 'The deno style "nodePath" option can be used - "node" option' , testDenoExecPath , runWithNodeOption ) ;
189+ test ( 'The deno style "nodePath" option can be used - "node" option sync' , testDenoExecPath , runWithNodeOptionSync ) ;
190+
177191const testNodeOptions = async ( t , execaMethod ) => {
178192 const { stdout} = await execaMethod ( 'empty.js' , [ ] , { nodeOptions : [ '--version' ] } ) ;
179193 t . is ( stdout , process . version ) ;
0 commit comments