I am doing first steps with Purescript and replicated "hello world" app.
Test passes. I broke the test deliberately.
module Test.Main where
import Prelude
import Effect (Effect)
import Euler (answer)
import Test.Assert (assert)
main :: Effect Unit
main = do
assert (answer == 233161)
The handmade error is reported, but quality of the error report worries me because it doesn't help anyhow with spotting the error. There is a verbose JS stacktrace without any reference to origin file or Purescript module/function! This is a super simple app with 1 test, but how I am supposed to find that needle in a haystack of myriads of tests in a real app?
spago test
[info] Installation complete.
Compiling Test.Main
[info] Build succeeded.
/home/dan/demo/pure-script/1/output/Test.Assert/foreign.js:6
if (!success) throw new Error(message);
^
Error: Assertion failed
at Object.main (/home/dan/demo/pure-script/1/output/Test.Assert/foreign.js:6:27)
at Object.<anonymous> (/home/dan/demo/pure-script/1/.spago/run.js:3:32)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
at startup (internal/bootstrap/node.js:282:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)
[error] Tests failed: exit code: 1