@@ -7,6 +7,7 @@ import {execa, execaSync, execaNode} from '../../index.js';
7
7
import { FIXTURES_DIRECTORY } from '../helpers/fixtures-directory.js' ;
8
8
import { identity , fullStdio } from '../helpers/stdio.js' ;
9
9
import { foobarString } from '../helpers/input.js' ;
10
+ import { getDenoNodePath } from '../helpers/file-path.js' ;
10
11
11
12
process . chdir ( FIXTURES_DIRECTORY ) ;
12
13
@@ -73,6 +74,9 @@ test('Cannot use "node" as binary - "node" option sync', testDoubleNode, 'node',
73
74
test ( 'Cannot use path to "node" as binary - execaNode()' , testDoubleNode , process . execPath , execaNode ) ;
74
75
test ( 'Cannot use path to "node" as binary - "node" option' , testDoubleNode , process . execPath , runWithNodeOption ) ;
75
76
test ( '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 ) ;
76
80
77
81
const getNodePath = async ( ) => {
78
82
const { path} = await getNode ( TEST_NODE_VERSION ) ;
@@ -174,6 +178,16 @@ test.serial('The "nodePath" option is relative to "cwd" - execaNode()', testCwdN
174
178
test . serial ( 'The "nodePath" option is relative to "cwd" - "node" option' , testCwdNodePath , runWithNodeOption ) ;
175
179
test . serial ( 'The "nodePath" option is relative to "cwd" - "node" option sync' , testCwdNodePath , runWithNodeOptionSync ) ;
176
180
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
+
177
191
const testNodeOptions = async ( t , execaMethod ) => {
178
192
const { stdout} = await execaMethod ( 'empty.js' , [ ] , { nodeOptions : [ '--version' ] } ) ;
179
193
t . is ( stdout , process . version ) ;
0 commit comments