jeudi 6 avril 2017

How to put wait in mocha nodejs

CODE -

.then (() => {
            console.log("Wait");
            setTimeout(function(){console.log("Wait to process")},1500);        
            this.timeout(2000);     
          })
.then(() => {
            console.log("Get ABC");
            return common.getApiData(url)})

Now when i run this code it logs data like - Wait Get ABC Wait to process (The it waits for the time specified above)

I want to put timeout before calling getApiData method..

Aucun commentaire:

Enregistrer un commentaire