File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 1+ import { spawnSync } from 'node:child_process' ;
2+ import { resolve } from 'node:path' ;
3+ import { fileURLToPath } from 'node:url' ;
4+
5+ import { describe , expect , it } from 'vitest' ;
6+
7+ const __dirname = fileURLToPath ( new URL ( '.' , import . meta. url ) ) ;
8+ const nodePath = process . execPath ;
9+ const actionPath = resolve ( __dirname , '../dist/index.js' ) ;
10+ const tmpPath = resolve ( __dirname , '../node_modules/.tmp' ) ;
11+
12+ describe ( 'integration' , ( ) => {
13+ it ( 'runs action' , ( ) => {
14+ const env = {
15+ 'INPUT_CLI-NAME' : 'gh' ,
16+ 'INPUT_CLI-VERSION' : '2.27.0' ,
17+ RUNNER_TOOL_CACHE : resolve ( tmpPath , 'runner_tool_cache' ) ,
18+ RUNNER_TEMP : resolve ( tmpPath , 'runner_temp' ) ,
19+ } ;
20+
21+ const result = spawnSync ( nodePath , [ actionPath ] , {
22+ env,
23+ stdio : 'ignore' , // 'inherit' to stream output in real-time
24+ } ) ;
25+
26+ expect ( result . status ) . toBe ( 0 ) ;
27+ } ) ;
28+ } ) ;
You can’t perform that action at this time.
0 commit comments