vendredi 26 octobre 2018

How to pass chai assertions to component using react

I am using the Chai assertion library in order to run some trivial tests on my code. I have a react component running on the client. It needs to receive assertion statements as props. Right now i am passing Strings like assert.isDefined(myVariable) and just run them using eval(). I am not happy with the state of things. How could i pass an array of assertions using props without using eval?

Thanks for your help.

Aucun commentaire:

Enregistrer un commentaire