Some elm-test output invisible

If I have nested describe groups in my test file and a test fails, all but the innermost description of the failed test is shown with the text colour the same as the background colour. I’ve tried changing the background colour, but the problem persists. So if I have (from the tutorial I’m following, but with an intentional error - and I can’t work out how to get code indented in this forum!):

fullAdderTests =
    describe "Full adder"
        [ describe "When both inputs are 0"
            [ test "and carry-in is 0 too, then both sum and carry-out are 0" <|
                \_ ->
                    fullAdder 0 0 0
                        |> Expect.equal { carry = 0, sum = 0 }
            , test "and carry-in is 1 then the sum is 1 and the carry-out is 0" <|
                \_ ->
                    fullAdder 0 0 1
                        |> Expect.equal { carry = 0, sum = 0 }
            ]
            -- more descriptions and tests
    ]

then all I see is:

elm-test 0.19.1-revision5
-------------------------                                                                                                                                            
                                                                                                                                                                     
Running 22 tests. To reproduce these results, run: elm-test --fuzz 100 --seed 358144159470230 tests\RippleCarryAdderTests.elm



and carry-in is 1 then the sum is 1 and the carry-out is 0                                                                                                                                                                     

    { carry = 0, sum = 1 }
    │
    │ Expect.equal
    │    
    { carry = 0, sum = 0 }                                                                                                                                                                     


TEST RUN FAILED

If I select the blank area, then I can see the hidden

RippleCarryAdderTests
Full adder
When both inputs are 0

How do I get it to show the hidden lines?

(I’m using ConEmu on Windows 10 - because I can’t get elm-test to work in PowerShell).

Hi!

To get code indented, type this:

```
<paste your code here>
```

That is, three “backticks”, a newline, whatever you want, a newline and three backticks again.

That would help both for your code and the elm-test output!

Now, the describe block titles are printed in dark grey. I suspect that’s why you don’t see it! I had a similar issue on Mac with the iTerm2 terminal – some colors just weren’t visible. After some googling I found that there’s a contrast slider in the iTerm2 settings. After fiddling with it I found a spot where I could see all colors!

So maybe ConEmu has something similar? Or at least a way to change its color theme – try another theme and see if you can see the colors then.

It would of course be the best if the elm-test colors worked out of the box in as many environments as possible. I haven’t look into if there’s a better way elm-test can do its colors, or if this is completely up to the user in this case. Another thing I noticed is that elm-test has no --no-color flag and doesn’t obey the NO_COLOR environment variable. That would have been handy in cases like this! EDIT: Turns out you can run elm-test | cat to disable colors. Not obvious, and I’m not sure how to do it on Windows. EDIT2: Setting FORCE_COLOR=0 disables colors!

Also, I’m interested in what errors you get when you try elm-test in PowerShell?

1 Like

Thanks for the heads-up on indenting!

ConEmu doesn’t have a contrast slider, but it allows me to select background colour. Unfortunately, when I change it, the invisible lines change with it and stay invisible!

I don’t know a Windows/Dos equivalent to cat that I can pipe into. If I pipe into a file and then view it, I can’t see any ASCII colour codes (even in a hex editor), but at least I can see the missing text.

In Powershell, I get a series of errors when I run elm-test:

Compiling > Starting tests
Error: connect ENOENT \\.\pipe\elm_test-5520-1
    at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1146:16) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'connect',
  address: '\\\\.\\pipe\\elm_test-5520-1'
}
Error: connect ENOENT \\.\pipe\elm_test-5520-1
    at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1146:16) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'connect',
  address: '\\\\.\\pipe\\elm_test-5520-1'
}
Error: connect ENOENT \\.\pipe\elm_test-5520-1
    at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1146:16) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'connect',
  address: '\\\\.\\pipe\\elm_test-5520-1'
}
Error: connect ENOENT \\.\pipe\elm_test-5520-1
    at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1146:16) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'connect',
  address: '\\\\.\\pipe\\elm_test-5520-1'
}


There was an unexpected runtime exception while running tests
1 Like

Thanks for the extra info!

I tried running elm-test in PowerShell, and for me it ran successfully.

I also checked the colors. The parts that I said were grey are white in cmd.exe and PowerShell on my system (on black/blue background), so it should be legible by default there at least.

Unfortunately I’m not able to debug more than that. But on the upside, --no-color is coming the the next version of elm-test! Fix --no-color by lydell · Pull Request #491 · rtfeldman/node-test-runner · GitHub – EDIT: It is now released (versioin 0.19.1-revision6)!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.