简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM