Module

Test.Spec

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

#SpecT Source

newtype SpecT g i m a

Constructors

Instances

#SpecTree Source

type SpecTree m a = Tree (ActionWith m a) (Item m a)

#mapSpecTree Source

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

#collect Source

collect :: forall a i g m. 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 b a i m m'. Monad m' => (m ~> m') -> (ComputationType -> a ~> b) -> (SpecT a i m) ~> (SpecT b i m')

#Example Source

class Example t arg m | t -> arg, t -> m where

Members

Instances

#parallel Source

parallel :: forall a i g m. 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 a i g m. 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 a i g m. 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 a i g m. 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 g arg t m. 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 a i g m. 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 g arg t m. Monad m => Example t arg g => String -> t -> SpecT g arg m Unit

Create a spec with a description.

#pending Source

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

Create a pending spec.

#pending' Source

pending' :: forall i g m. 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 a i' i g m. 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 a i g m. 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 a i g m. 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 a i g m. 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 a i g m. 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 a i' i g m. 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 a i g m. 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 a i g m. 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 a i f e g m. 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 a i f e g m. 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 a i g m. 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 a i g m. 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 c a

Constructors

Instances

#Item Source

newtype Item m a

Constructors

Instances

#ActionWith Source

type ActionWith m a = a -> m Unit