PureScript
Status
Beta
Versions
Test Frameworks
Example
The name of the solution module can be arbitrary. Extra module can be provided in preloaded code.
module Example where
import Prelude
add' :: Int -> Int -> Int
add' x y = x + ymodule Example where
import Prelude
add' :: Int -> Int -> Int
add' x y = x + yThe name of the test module must end with Spec.
module ExampleSpec where
import Prelude
import Test.Spec (Spec, describe, it)
import Test.Spec.Assertions (shouldEqual)
import Example (add')
spec :: Spec Unit
spec =
describe "Example" do
describe "add'" do
it "returns sum" do
(add' 1 1) `shouldEqual` 2module ExampleSpec where
import Prelude
import Test.Spec (Spec, describe, it)
import Test.Spec.Assertions (shouldEqual)
import Example (add')
spec :: Spec Unit
spec =
describe "Example" do
describe "add'" do
it "returns sum" do
(add' 1 1) `shouldEqual` 2QuickCheck is supported.
module QuickCheckExampleSpec where
import Prelude
import Test.QuickCheck ((===))
import Test.Spec (Spec, describe, it)
import Test.Spec.QuickCheck (quickCheck)
spec :: Spec Unit
spec =
describe "QuickCheck" do
it "works" $
quickCheck \n -> (n * 2 / 2) === nmodule QuickCheckExampleSpec where
import Prelude
import Test.QuickCheck ((===))
import Test.Spec (Spec, describe, it)
import Test.Spec.QuickCheck (quickCheck)
spec :: Spec Unit
spec =
describe "QuickCheck" do
it "works" $
quickCheck \n -> (n * 2 / 2) === nTimeout
12 seconds
Packages
preludeconsoledebugeffectbigintsrationalsprofunctor-lensesspecspec-discoveryspec-quickcheck
Packages are managed with psc-package using package set psc-0.12.2-20190119. See packages.json for versions.
Feel free to open issues for additional packages.
Services
None
Language ID
purescript