const { waitFor } = require('sat-utils')
waitFor.setDefaultOpts({
timeout: 2500, // default waiting time is 2500 ms
interval: 250, // default re-check condition interval time is 250 ms
message: 'Failed', // default error message is "Failed"
waiterError: TypeError, // default error is TypeError
});
test()
async function test() {
await waitFor(async () => {
const result = await someAsyncLogic()
return result;
})
}
test1()
async function test1() {
await waitFor(async () => {
const result = await someAsyncLogic()
return result;
}, {
analyseResult: (result) => result.status === 200;
timeout: 25000,
interval: 250,
message: (time) => throw new Error(`My custom error throw function with time ${time}`)
})
}
-
Notifications
You must be signed in to change notification settings - Fork 0
License
Simple-Automation-Testing/sat-wait
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published