Search code examples
javascriptjasmineprotractorjasmine-node

Saving jasmine expect() results


Does expect() have a return type (or a promise it fulfills)? If not, how can I store/access the result of an it('should...')'s expect()?

Edited-Clarification: I want to store and use these results during subsequent tests.

Reason: I'd like to make some tests resilient enough to know if they should be skipped because prior tests failed, without having to make the comparison a second time and wait for nested promises to all resolve again.


Solution

  • Have a look at the http://jasmine.github.io/2.3/custom_reporter.html which allows you to be notified of the suite/specs success/failure as they are executed.

    You could then store this information in an object which could then be accessible to your specs.