dimanche 25 janvier 2015

How do you test for throwing an error message in jasmine?

I have a method that throws an error message and I can't seem to get my test to pass. At the moment it looks like this:


Javascript



else {
throw Error('uh oh, you cannot do this');
}


Jasmine Spec



expect(frame.bowl(5)).toThrowError("uh oh, you cannot do this");

Aucun commentaire:

Enregistrer un commentaire