File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -107,6 +107,21 @@ describe('CLI Output Option', () => {
107107 } ) ;
108108} ) ;
109109
110+ describe ( 'CLI Bash Syntax Validation' , ( ) => {
111+ it ( 'should fail compilation when generated script has bash syntax errors' , ( ) => {
112+ const command = 'node dist/cli/index.js compile tests/workflows/invalid-bash-test.yaml' ;
113+
114+ try {
115+ execSync ( command , { encoding : 'utf8' } ) ;
116+ expect ( false ) . toBe ( true ) ;
117+ } catch ( error : any ) {
118+ const errorOutput = error . stderr ?. toString ( ) ?? error . stdout ?. toString ( ) ?? error . message ;
119+ expect ( errorOutput ) . toContain ( 'Compilation failed:' ) ;
120+ expect ( errorOutput ) . toContain ( 'Bash syntax validation failed' ) ;
121+ }
122+ } ) ;
123+ } ) ;
124+
110125describe ( 'CLI DSL Command' , ( ) => {
111126 it ( 'should execute dsl command and show DSL structure' , ( ) => {
112127 const command = 'node dist/cli/index.js dsl' ;
Original file line number Diff line number Diff line change 1+ workflow :
2+ name : ' Invalid Bash'
3+ description : ' Workflow with intentionally invalid bash to test syntax validation'
4+
5+ graph :
6+ nodes :
7+ - id : ' start'
8+ type : ' start'
9+ data :
10+ title : ' Start'
11+
12+ - id : ' invalid_command'
13+ type : ' code'
14+ data :
15+ title : ' Invalid Command'
16+ description : ' Command with unterminated quote'
17+ command : ' echo "unterminated'
18+
19+ - id : ' end'
20+ type : ' end'
21+ data :
22+ title : ' End'
23+
24+ edges :
25+ - id : ' start_to_invalid'
26+ source : ' start'
27+ target : ' invalid_command'
28+
29+ - id : ' invalid_to_end'
30+ source : ' invalid_command'
31+ target : ' end'
You can’t perform that action at this time.
0 commit comments