Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.
Has anyone used the Network.Wai.Test module from wai-extra along with Persistent to test their handlers?
I'm trying to use it with tasty-wai: https://hackage.haskell.org/package/tasty-wai-0.1.1.0/docs/Test-Tasty-Wai.html
I opened a raw connection in my tests main, passed it to my API tests as well as the my app :: SqlBackend -> Application, and used a runDB function to run the SQL bits in my tests. It worked fine when I had a single test, but once I added another test with another sql block, it gave me an error:
app :: SqlBackend -> Application
Exception: SQLite3 returned ErrorError while attempting to perform step: cannot start a transaction within a transaction
Urg, just had to switch the test-suite to single-threaded...