mardi 5 mars 2019

Conditionally run a test case if first test case is passed or failed - jest

I have a method updateHeight() in a class based component that updates arrows height based on image height. when there are no arrows then it returns false.

I want to write a test case that checks if an arrow exists and then function should not return false and Vice versa.

e.g;

let arrows expect(wrapper.find('.arrow').length).toBe(1);
if ( arrows ) {
    // run second test case
}

Aucun commentaire:

Enregistrer un commentaire