Skip to content
This repository has been archived by the owner on Oct 9, 2019. It is now read-only.

Test hitting a Debug.crash should return the test name #233

Open
simonh1000 opened this issue Mar 16, 2018 · 2 comments
Open

Test hitting a Debug.crash should return the test name #233

simonh1000 opened this issue Mar 16, 2018 · 2 comments

Comments

@simonh1000
Copy link

simonh1000 commented Mar 16, 2018

I am hitting a Debug.crash with some of my tests. In other words I'm reaching a place that I thought was impossible to get to so i'm pretty keen to see what is happening. But I don't get the name of the test that crashed, and I have 380 of them,... Is there something I can do?

Here's the sort of output I'm seeing

 $ elm-test
Success! Compiled 37 modules.                                       
Successfully generated /dev/null
Success! Compiled 1 module.                                         
Successfully generated /home/simon/code/sync/remix/turntable/side-chain/elm-stuff/generated-code/elm-community/elm-test/elmTestOutput.js
/home/simon/code/sync/remix/turntable/side-chain/elm-stuff/generated-code/elm-community/elm-test/elmTestOutput.js:1582
		throw new Error(
		^

Error: Ran into a `Debug.crash` in module `L2.CodegenHelpers`

This was caused by the `case` expression between lines 320 and 338.
One of the branches ended with a crash and the following value got through:

    (True,True)

The message provided by the code author is:

    *****Cannot loop over main binding of an object
    at /home/simon/code/sync/remix/turntable/side-chain/elm-stuff/generated-code/elm-community/elm-test/elmTestOutput.js:1582:9
    at /home/simon/code/sync/remix/turntable/side-chain/elm-stuff/generated-code/elm-community/elm-test/elmTestOutput.js:37799:13
    at Function.func (/home/simon/code/sync/remix/turntable/side-chain/elm-stuff/generated-code/elm-community/elm-test/elmTestOutput.js:37833:5)
    at A6 (/home/simon/code/sync/remix/turntable/side-chain/elm-stuff/generated-code/elm-community/elm-test/elmTestOutput.js:158:11)
    at Function.func (/home/simon/code/sync/remix/turntable/side-chain/elm-stuff/generated-code/elm-community/elm-test/elmTestOutput.js:38099:4)
    at A6 (/home/simon/code/sync/remix/turntable/side-chain/elm-stuff/generated-code/elm-community/elm-test/elmTestOutput.js:158:11)
    at Function.func (/home/simon/code/sync/remix/turntable/side-chain/elm-stuff/generated-code/elm-community/elm-test/elmTestOutput.js:38111:14)
    at A4 (/home/simon/code/sync/remix/turntable/side-chain/elm-stuff/generated-code/elm-community/elm-test/elmTestOutput.js:146:11)
    at /home/simon/code/sync/remix/turntable/side-chain/elm-stuff/generated-code/elm-community/elm-test/elmTestOutput.js:39085:6
    at Function.func (/home/simon/code/sync/remix/turntable/side-chain/elm-stuff/generated-code/elm-community/elm-test/elmTestOutput.js:39088:4)


There was an unexpected runtime exception while running tests


/home/simon/code/sync/remix/turntable/side-chain/elm-stuff/generated-code/elm-community/elm-test/elmTestOutput.js:1582
		throw new Error(
		^

Error: Ran into a `Debug.crash` in module `L2.CodegenHelpers`

This was caused by the `case` expression between lines 320 and 338.
One of the branches ended with a crash and the following value got through:

    (True,True)

The message provided by the code author is:

    *****Cannot loop over main binding of an object
    at /home/simon/code/sync/remix/turntable/side-chain/elm-stuff/generated-code/elm-community/elm-test/elmTestOutput.js:1582:9
@rtfeldman
Copy link
Member

In 0.19 we can (and should, I think!) introduce this feature in this repo.

In the meantime I have an idea for how to do it in node-test-runner.

@simonh1000
Copy link
Author

One thing I just found was that I would get the unhelpful error when I ran elm-test alone, but I get the specific test name back when I run elm-test tests/TestFile.elm, i.e. with the full name of a test file

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants