mardi 31 mars 2015

Node mocha array should contain an element

I want to do a simple assertion of something like



knownArray.should.include('known value')


The array is correct, but I simply can't figure out the proper assertion to use to check whether the array has this value (the index doesn't matter). I also tried should.contain but both of these throw an error that Object #<Assertion> has no method 'contain' (or 'include')


How can I check that an array contains an element using should?


Aucun commentaire:

Enregistrer un commentaire