I am working on my first major Haskell application, and want to add mockery to create disposable test WAI threads. Importing mockery and running stack test
resulted in the compiler error:
Failed to load interface for ‘Test.Mockery.Directory’
It is a member of the hidden package ‘mockery-0.3.5’.
Perhaps you need to add ‘mockery’ to the build-depends in your .cabal file.
Use -v to see a list of the files searched for.
So, I added mockery to my cabal file under test dependencies. However, when I run stack build
or stack test
mockery is automatically removed from the cabal file.
I have also tried listing mockery-0.3.5
under extra-deps
in the stack.yaml
file. This unsurprisingly didn't work, since mockery is part of my lts, and extra deps is for packages outside of lts.
How can I get stack to recognize that mockery should be included as a dependency to to project?
Here is my stack.yaml:
flags: {}
ghc-options:
! '*': -Wall
packages:
- .
extra-deps: [
]
resolver: lts-9.5
I'm using stack version 1.5.1
I imagine this is a stupid build issue and look forward to confronting my obvious oversight.
.cabal
file for you. Add the dependency in thepackage.yaml
file, instead. - Alexis King