thentos icon indicating copy to clipboard operation
thentos copied to clipboard

hspec open questions

Open mf59816 opened this issue 9 years ago • 2 comments

In FrontendSpec, we say, after several other tests and after the before and after wrapper:

  -- (this is a separate top-level test case because it changes the DB
  -- state and gets the other tests confused.)
  describe "update user" . before setupTestServerFull . after teardownTestServerFull $ do
    spec_updateSelf

I thought though that each it should run in a state pristinely constructed by before, and torn down right after. See tests described as meta in ThentosSpec. What's with that?

mf59816 avatar Jun 12 '15 10:06 mf59816

The text above is confusing, let me clarify:

  1. is there any way we can run several its in the same before-after bracket?
  2. how can we make tests faster?
  3. (see above) remove misleading comment and consider restructuring test cases.

fisx avatar Jul 16 '15 08:07 fisx

There's beforeAll, afterAll that would do this (though by now FrontendSpec uses around, which doesn't have an aroundAll variant).

robx avatar Sep 09 '15 20:09 robx