Use a jasmine matcher to return a true/false for angular $httpBackend.expect ?

32 views
Skip to first unread message

Dries De Smet

unread,
Jan 26, 2016, 1:12:56 PM1/26/16
to Jasmine
Hi,

I'm using Jasmine in an angular environment & in combination with the $httpBackend.expectPost().

It's possible to test the returned object by using a function which passes in the to be tested data, and it expects a boolean return value.

I was hoping to use the jasmine library, since some of the content has wildcards, but was wondering if jasmine matchers could be used in this case?

Or if anyone knows how these expect's with $httpbackend could be more flexible?

Thanks in advance!

Gregg Van Hove

unread,
Feb 18, 2016, 6:38:08 PM2/18/16
to jasmi...@googlegroups.com
Jasmine matchers don't have a return value so you probably wouldn't be able to return the result of calling an `expect` chain. However, having failing expectations in the function should then cause the jasmine spec itself to fail with the appropriate message.

Hope this helps. Thanks for using Jasmine!

-Gregg

--
You received this message because you are subscribed to the Google Groups "Jasmine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jasmine-js+...@googlegroups.com.
To post to this group, send email to jasmi...@googlegroups.com.
Visit this group at https://groups.google.com/group/jasmine-js.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages