Skip to content

forAll :: ∀ e a f. Foldable f => (a -> String) -> String -> f a -> (a -> Aff e Unit) -> Spec e Unit #49

Open
@safareli

Description

@safareli

What are thoughts on adding something like this this?

forAll ::  e a f. Foldable f => (a -> String) -> String -> f a -> (a -> Aff e Unit) -> Spec e Unit
forAll itTitle title arb f = describe title do
  for_ arb \a -> it (itTitle a) (f a)

...
  forAll _.str "format (unformat a) = a" arb \({ str }) -> do
    (format $ unformat str) `shouldEqual` (Right str) 
...

I have been using for_ in it block but if some test case fails then other items are not tested and you can't see them in log. using this function you can see each item in log and all of them will be executed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions