You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.
I was trying to use the ionic serve feature to execute some automated tests on my app using the following:
//some codevarpromise=Q();returnpromise.then(function(){returnServe.start(options);}).then(function(){//execute some tests}).finally(function(){returnServe.stopServer();});
But, I was getting an error stating that the server was not running. Looking at the code of server.js I found out that when Serve.start is called, it doesn't wait for the server to really start before returning, so we had no garantee that the server would be running when Server.stop is called.
Therefore, I propose the following solution:
Serve.startServer=functionstartServer(options,app){// original code// Listenvarq=Q.defer();app.use(server);try{runningServer=app.listen(options.port,options.address,function(){logging.logger.info('Running dev server: '.green.bold,options.devServer);q.resolve()});}catch(ex){q.reject(Utils.fail('Failed to start the Ionic server: ',ex.message));}returnq.promise;}
WHat do you think?
The text was updated successfully, but these errors were encountered:
Hi!
I was trying to use the ionic serve feature to execute some automated tests on my app using the following:
But, I was getting an error stating that the server was not running. Looking at the code of server.js I found out that when Serve.start is called, it doesn't wait for the server to really start before returning, so we had no garantee that the server would be running when Server.stop is called.
Therefore, I propose the following solution:
WHat do you think?
The text was updated successfully, but these errors were encountered: