Page 1 of 1

Stop a Test for some time

Posted: Fri Jan 22, 2021 12:29 pm
by Clothia C

Is it possible to use some kind of await in a Test.

Example:

describe('Sanity Test', t => {
    t.it("Sanity", t => {
        t.diag("Sanity test");
	    // something like this
	    await t.ok(foo, 'foo => Available after 5 seconds');
	    // not continue before foo available
        t.requireOk('Ext.Img');
    });
})

Re: Stop a Test for some time

Posted: Fri Jan 22, 2021 12:35 pm
by nickolay

Of course, just declare the test function as async: t.it("Sanity", async t => {...})


Re: Stop a Test for some time

Posted: Fri Jan 22, 2021 3:56 pm
by Clothia C

Works great, thanks