Module

Test.Spec

Package
purescript-spec
Repository
purescript-spec/purescript-spec

#SpecT Source

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

Constructors

Instances

#SpecTree Source

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

A specialization of Tree for the tree of actual tests. While Tree is a tree of abstract things, SpecTree is a tree of tests, each represented by Item.

#mapSpec Source

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

#mapSpecTree Source

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 Source

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 Source

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

#Example Source

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

Members

Instances

#parallel Source

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 Source

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 Source

class FocusWarning 

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

Instances

#focus Source

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 Source

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 Source

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 Source

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 Source

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 Source

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

Create a pending spec.

#pending' Source

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 Source

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 Source

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_ Source

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 Source

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_ Source

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 Source

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 Source

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_ Source

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 Source

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_ Source

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 Source

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_ Source

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 Source

data Tree n c a

Constructors

Instances

#Item Source

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

Constructors

Instances

#ActionWith Source

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