Wrapping Describe/It blocks with WaitsFor/Runs in Jasmine 1.3

27 views
Skip to first unread message

jordan...@gmail.com

unread,
Jun 10, 2016, 12:49:07 AM6/10/16
to Jasmine
For various reasons, I am unable to update to newer version of Jasmine so I am stuck with the WaitsFor/Runs async methods. 

What I would like is to have functionality where I can wait for an async function finish, and nest Describe/It blocks in the Runs block, though Jasmine doesn't seem to like this. Is something like this even possible?

Gregg Van Hove

unread,
Aug 16, 2016, 2:31:55 PM8/16/16
to jasmi...@googlegroups.com
The async functionality of Jasmine (`waitsFor`/`runs` or `done`) only work during the execution of the specs. If you want to wait until some external event before determining how many specs (or which specs) need to exist, you'll probably need to boot Jasmine manually and wait until everything is done before executing the specs.

If you just need to wait for something external before completing a single spec, you should be able to use `waitsFor`/`runs` within the individual `it`, or `beforeEach`.

Hope this helps. Thanks for using Jasmine!

-Gregg

On Thu, Jun 9, 2016 at 5:22 PM, <jordan...@gmail.com> wrote:
For various reasons, I am unable to update to newer version of Jasmine so I am stuck with the WaitsFor/Runs async methods. 

What I would like is to have functionality where I can wait for an async function finish, and nest Describe/It blocks in the Runs block, though Jasmine doesn't seem to like this. Is something like this even possible?

--
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+unsubscribe@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