Skip to content

Repository files navigation

SAT WAITING LIBRARY

npm downloads

Content

waitFor

const{ waitFor }=require('sat-utils')waitFor.setDefaultOpts({timeout: 2500,// default waiting time is 2500 msinterval: 250,// default re-check condition interval time is 250 msmessage: 'Failed',// default error message is "Failed"waiterError: TypeError,// default error is TypeError});test()asyncfunctiontest(){awaitwaitFor(async()=>{constresult=awaitsomeAsyncLogic()returnresult;})}test1()asyncfunctiontest1(){awaitwaitFor(async()=>{constresult=awaitsomeAsyncLogic()returnresult;},{analyseResult: (result)=>result.status===200;
timeout: 25000,interval: 250,message: (time)=>thrownewError(`My custom error throw function with time ${time}`)})}

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages