Get help with testing, discuss unit testing strategies etc.


Post 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');
    });
})

Post by nickolay »

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


Post by Clothia C »

Works great, thanks


Post Reply