@@ -47,6 +47,9 @@ const fsm = input('fsm.json'), fsmStruct = JSON.parse(fs.readFileSync(fsm.path).
4747 demo = composerInput ( 'demo.js' ) ,
4848 demoRetain = composerInput ( 'demo-retain.js' ) ,
4949 mask = composerInput ( 'mask.js' ) ,
50+ requireAbsolute = composerInput ( 'require-absolute.js' ) ,
51+ requireRelative = composerInput ( 'require-relative.js' ) ,
52+ fsRead = composerInput ( 'fs-read.js' ) ,
5053 addSubscription = composerErrorInput ( 'addSubscription.js' )
5154
5255/**
@@ -237,6 +240,27 @@ describe('show the composer visualization without creating openwhisk assets', fu
237240 . then ( verifyEdgeExists ( 'echo1' , 'echo2' ) )
238241 . catch ( common . oops ( this ) ) )
239242
243+ /** test: from the openwhisk-composer/samples directory */
244+ it ( `show visualization from javascript source ${ requireAbsolute . path } ` , ( ) => cli . do ( `app viz ${ requireAbsolute . path } ` , this . app )
245+ . then ( verifyTheBasicStuff ( requireAbsolute . file , 'composerLib' ) )
246+ . then ( verifyNodeExists ( 'echo1' ) )
247+ . then ( verifyNodeExists ( 'echo2' ) )
248+ . then ( verifyEdgeExists ( 'echo1' , 'echo2' ) )
249+ . catch ( common . oops ( this ) ) )
250+
251+ /** test: from the openwhisk-composer/samples directory */
252+ it ( `show visualization from javascript source ${ requireRelative . path } ` , ( ) => cli . do ( `app viz ${ requireRelative . path } ` , this . app )
253+ . then ( verifyTheBasicStuff ( requireRelative . file , 'composerLib' ) )
254+ . then ( verifyNodeExists ( 'echo1' ) )
255+ . then ( verifyNodeExists ( 'echo2' ) )
256+ . then ( verifyEdgeExists ( 'echo1' , 'echo2' ) )
257+ . catch ( common . oops ( this ) ) )
258+
259+ /** test: from the openwhisk-composer/samples directory */
260+ it ( `show visualization from javascript source ${ fsRead . path } ` , ( ) => cli . do ( `app viz ${ fsRead . path } ` , this . app )
261+ . then ( verifyTheBasicStuff ( fsRead . file , 'composerLib' ) )
262+ . catch ( common . oops ( this ) ) )
263+
240264 it ( `fail to show visualization for addSubscription without -e for env var assignment` , ( ) => cli . do ( `preview ${ addSubscription . path } ` , this . app )
241265 . then ( cli . expectError ( 0 , 'SLACK_TOKEN required in environment' ) )
242266 . catch ( common . oops ( this ) ) )
0 commit comments