lundi 30 janvier 2017

AVA testing throws

I am trying to test by throwing error.

 test('throws', t => {
    t.throws(() => { 
    valid(1) }, "Error can't put number");
 });

So the valid is function and when I put number I want to throw the error. Right now it gives me AssertionError: Missing expected exception (err)..

Not sure what I am doing wrong.

Aucun commentaire:

Enregistrer un commentaire