async work in beforeEach and afterEach

29 views
Skip to first unread message

Davis Frank

unread,
Jul 19, 2009, 1:32:54 AM7/19/09
to jasmi...@googlegroups.com
I got an interesting feature request that I don't think we'd thought through.

Someone was trying to use runs() and waitsFor() in an afterEach() block b/c they needed to delete something via an async call - this was API testing, not app testing where you'd mock something like this out.

It looks like async stuff is supported in beforeEach(), which makes sense given how we implemented the waits.

I told him how to do it in a "wet" way - just do the deletion at the end of each spec.

Should we be considering adding this?

--dwf

Christian Williams

unread,
Jul 20, 2009, 4:00:51 AM7/20/09
to jasmi...@googlegroups.com, jasmi...@googlegroups.com
Seems like the least surprising thing is to have runs/waitsFor work
consistently everywhere. Does it just ignore 'em in afters?

I guess it should be implemented as a pop-until-empty, since more runs
could be registered by a runs in the after. Trippy.

--X [typos courtesy of my iPhone]
Reply all
Reply to author
Forward
0 new messages