dimanche 3 juin 2018

Cyclical Object Value Test Double

I want to test error handling for JSON.stringify as part of a class method, and to introduce an error I need to use an object that it throws a TypeError on.

According to the Mozilla docs the only object that will fail is a cyclic object value.

Is there an easy way to make a test double to write a test for this scenario?

Aucun commentaire:

Enregistrer un commentaire