lundi 4 décembre 2017

AVA: setup different timeout for each test case

I writing asynchronous tests using AVA, and need to setup custom timeout for each test cases. I've not found out any information about this possibility and my tests seems like this:

import test from 'ava';

test.cb('super test', t => {
    setTimeout(() => {
        t.is(1, 1);
        t.end();
    }, 10000);

    setTimeout(() => {
        t.fail("Timeout error!");
        t.end();
    }, 100);
});

Does anybody know another way to implement this in AVA?

Aucun commentaire:

Enregistrer un commentaire