Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use HSpec.Wai with hspec-discover? #75

Open
mklinik opened this issue Mar 16, 2023 · 1 comment
Open

How to use HSpec.Wai with hspec-discover? #75

mklinik opened this issue Mar 16, 2023 · 1 comment

Comments

@mklinik
Copy link

mklinik commented Mar 16, 2023

I'm trying to use hspec-discover with HSpec.Wai. The top-level spec items in my FooSpec.hs files are of type spec :: SpecWith (st, Application). I want to use my own Main module and driver, so I generate the test suite like this:

{-# OPTIONS_GHC -F -pgmF hspec-discover -optF --module-name=APISpec -optF --no-main #-}

However, hspec-discover generates spec :: Spec in which it tries to run the (st, Application) specs from the test modules.

Is there a way to make hspec-discover generate a spec :: SpecWith (st, Application)? Or do I have to set up my tests differently?

@sol
Copy link
Member

sol commented Sep 15, 2023

You probably want to use spec hooks: https://hspec.github.io/hspec-discover.html#spec-hooks

We probably want to add an example to the README. PRs welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants