Skip to content

Instantly share code, notes, and snippets.

@jbrains
Created December 24, 2021 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbrains/ecef3b2a3397740a8496b66f0ad82941 to your computer and use it in GitHub Desktop.
Save jbrains/ecef3b2a3397740a8496b66f0ad82941 to your computer and use it in GitHub Desktop.
WANTED: A more concise way to execute a side effect in a test without checking its result
checkSellMultipleItems :: Spec Unit
checkSellMultipleItems =
describe "Sell Multiple Items" do
it "happy path" do
(POS.handleCommand $ TextCommand "12345") `shouldSatisfy` (const true)
(POS.handleCommand $ TextCommand "total") `shouldEqual` "Total: CAD 27.50"
@jbrains
Copy link
Author

jbrains commented Dec 24, 2021

I'm now slowly making this work. I'm either reinventing or resisting the State monad.

@jbrains
Copy link
Author

jbrains commented Dec 25, 2021

Apparently I wanted discard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment