@@ -7,13 +7,13 @@ import { fileURLToPath } from 'url'
77
88const __filename = fileURLToPath ( import . meta. url )
99const __dirname = dirname ( __filename )
10- describe ( "Ocean CLI Interactive Publishing" , function ( ) {
10+ describe ( "Ocean CLI Interactive Publishing" , function ( ) {
1111 this . timeout ( 120000 ) ; // Set a longer timeout to allow for user input simulation
1212
1313 const projectRoot = path . resolve ( __dirname , ".." ) ;
1414 let publishedDid : string ;
1515
16- it ( "should publish an asset using 'npm run cli start' interactive flow" , function ( done ) {
16+ it ( "should publish an asset using 'npm run cli start' interactive flow" , function ( done ) {
1717 process . env . PRIVATE_KEY = "0x1d751ded5a32226054cd2e71261039b65afb9ee1c746d055dd699b1150a5befc" ;
1818 process . env . RPC = "http://127.0.0.1:8545" ;
1919 process . env . NODE_URL = "http://127.0.0.1:8001" ;
@@ -43,7 +43,9 @@ describe("Ocean CLI Interactive Publishing", function() {
4343 if ( child . stdin ) {
4444 const inputInterval = setInterval ( ( ) => {
4545 if ( inputIndex < inputs . length ) {
46- child . stdin . write ( inputs [ inputIndex ] ) ;
46+ if ( child . stdin ) {
47+ child . stdin . write ( inputs [ inputIndex ] ) ;
48+ }
4749 inputIndex ++ ;
4850 } else {
4951 clearInterval ( inputInterval ) ;
@@ -61,7 +63,7 @@ describe("Ocean CLI Interactive Publishing", function() {
6163 expect ( code ) . to . equal ( 0 ) ;
6264 expect ( fullOutput ) . to . contain ( "Asset successfully published with DID:" ) ;
6365 expect ( fullOutput ) . to . contain ( "Metadata successfully updated for DID:" ) ;
64-
66+
6567 const match = fullOutput . match ( / d i d : o p : [ a - f 0 - 9 ] { 64 } / ) ;
6668 if ( match ) {
6769 publishedDid = match [ 0 ] ;
@@ -77,7 +79,7 @@ describe("Ocean CLI Interactive Publishing", function() {
7779 } ) ;
7880 } ) ;
7981
80- it ( "should get DDO using 'npm run cli getDDO' for the published asset" , function ( done ) {
82+ it ( "should get DDO using 'npm run cli getDDO' for the published asset" , function ( done ) {
8183 exec ( `npm run cli getDDO ${ publishedDid } ` , { cwd : projectRoot } , ( error , stdout ) => {
8284 try {
8385 expect ( stdout ) . to . contain ( `${ publishedDid } ` ) ;
0 commit comments