10
rated 0 times
[
13]
[
3]
/ answers: 1 / hits: 21281
/ 10 Years ago, sat, june 21, 2014, 12:00:00
I'm using Karma/Jasmine to test a given class. I need to test that an array contains an object with a given property, i.e. I don't want to specify the whole object (it is rather large and the test would become less maintainable if I had to).
I've tried the following:
expect(filters.available).toContain(jasmine.objectContaining({name:majors});
but this gave me the error 'jasmine' is not defined, and I haven't been able to figure out the cause of that error.
More From » arrays