Module

Test.Spec

#Spec

#SpecT

newtype SpecT :: (Type -> Type) -> Type -> (Type -> Type) -> Type -> Typenewtype SpecT g i m a

Constructors

Instances

#SpecTree

type SpecTree :: (Type -> Type) -> Type -> Typetype SpecTree m a = Tree (ActionWith m a) (Item m a)

#mapSpecTree

mapSpecTree :: forall m m' g g' i a i'. Functor m' => (m ~> m') -> (SpecTree g i -> SpecTree g' i') -> SpecT g i m a -> SpecT g' i' m' a

#collect

collect :: forall m g i a. Functor m => SpecT g i m a -> m (Array (SpecTree g i))

Collects all tests, if something is focused, all unfocused tests will be discarded

#hoistSpec

hoistSpec :: forall m' m i a b. Monad m' => (m ~> m') -> (ComputationType -> a ~> b) -> (SpecT a i m) ~> (SpecT b i m')

#Example

class Example :: Type -> Type -> (Type -> Type) -> Constraintclass Example t arg m | t -> arg, t -> m where

Members

Instances

#parallel

parallel :: forall m g i a. Monad m => SpecT g i m a -> SpecT g i m a

marks all spec items of the given spec to be safe for parallel evaluation.

#sequential

sequential :: forall m g i a. Monad m => SpecT g i m a -> SpecT g i m a

marks all spec items of the given spec to be evaluated sequentially.

#FocusWarning

class FocusWarning 

Nullary class used to raise a custom warning for the focusing functions.

Instances

#focus

focus :: forall m g i a. FocusWarning => Monad m => SpecT g i m a -> SpecT g i m a

focus focuses all spec items of the given spec.

Applying focus to a spec with focused spec items has no effect.

#describeOnly

describeOnly :: forall m g i a. FocusWarning => Monad m => String -> SpecT g i m a -> SpecT g i m a

Combine a group of specs into a described hierarchy and mark it as the only group to actually be evaluated. (useful for quickly narrowing down on a set)

#itOnly

itOnly :: forall m t arg g. FocusWarning => Monad m => Example t arg g => String -> t -> SpecT g arg m Unit

Create a spec with a description and mark it as the only one to be run. (useful for quickly narrowing down on a single test)

#describe

describe :: forall m g i a. Monad m => String -> SpecT g i m a -> SpecT g i m a

Combine a group of specs into a described hierarchy.

#it

it :: forall m t arg g. Monad m => Example t arg g => String -> t -> SpecT g arg m Unit

Create a spec with a description.

#pending

pending :: forall m g i. Monad m => String -> SpecT g i m Unit

Create a pending spec.

#pending'

pending' :: forall m g i. Monad m => String -> g Unit -> SpecT g i m Unit

Create a pending spec with a body that is ignored by the runner. It can be useful for documenting what the spec should test when non-pending.

#aroundWith

aroundWith :: forall m g i i' a. Monad m => (ActionWith g i -> ActionWith g i') -> SpecT g i m a -> SpecT g i' m a

Run a custom action before and/or after every spec item.

#around

around :: forall m g i a. Monad m => (ActionWith g i -> g Unit) -> SpecT g i m a -> SpecT g Unit m a

Run a custom action before and/or after every spec item.

#around_

around_ :: forall m g i a. Monad m => (g Unit -> g Unit) -> SpecT g i m a -> SpecT g i m a

Run a custom action before and/or after every spec item.

#before

before :: forall m g i a. Monad m => Monad g => g i -> SpecT g i m a -> SpecT g Unit m a

Run a custom action before every spec item.

#before_

before_ :: forall m g i a. Monad m => Monad g => g Unit -> SpecT g i m a -> SpecT g i m a

Run a custom action before every spec item.

#beforeWith

beforeWith :: forall m g i i' a. Monad m => Monad g => (i' -> g i) -> SpecT g i m a -> SpecT g i' m a

Run a custom action before every spec item.

#beforeAll

beforeAll :: forall m g i a. MonadEffect m => MonadAff g => MonadError Error g => g i -> SpecT g i m a -> SpecT g Unit m a

Run a custom action before the first spec item.

#beforeAll_

beforeAll_ :: forall m g i a. MonadEffect m => MonadAff g => MonadError Error g => g Unit -> SpecT g i m a -> SpecT g i m a

Run a custom action before the first spec item.

#after

after :: forall m g e f i a. Monad m => MonadBracket e f g => ActionWith g i -> SpecT g i m a -> SpecT g i m a

Run a custom action after every spec item.

#after_

after_ :: forall m g e f i a. Monad m => MonadBracket e f g => g Unit -> SpecT g i m a -> SpecT g i m a

Run a custom action after every spec item.

#afterAll

afterAll :: forall m g i a. Monad m => ActionWith g i -> SpecT g i m a -> SpecT g i m a

Run a custom action after the last spec item.

#afterAll_

afterAll_ :: forall m g i a. Monad m => g Unit -> SpecT g i m a -> SpecT g i m a

Run a custom action after the last spec item.

Re-exports from Test.Spec.Tree

#Tree

data Tree c a

Constructors

Instances

#Item

newtype Item :: (Type -> Type) -> Type -> Typenewtype Item m a

Constructors

Instances

#ActionWith

type ActionWith :: (Type -> Type) -> Type -> Typetype ActionWith m a = a -> m Unit

Modules