You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
moduleMyTestexposing (..)
importExpectimportTestexposing (..)
add1:Int->Intadd1 n =
n +1suite:Testsuite =
describe "Tests are here"[ describe "This one gets found"[ test "add1 1"<|\_ ->
add1 1|>Expect.equal 2], describe "This one doesn't"<|List.map
(\( label, input, output )->
test label <|\_ ->
add1 input
|>Expect.equal output
)[("add1 2",2,3),("add1 3",3,4)]]
Expected Behavior
I would expect the test explorer panel to find and display all three tests in the tests list when you open or refresh the panel.
Current Behavior
The explorer panel only finds the first test
If I click the button to run all tests, the explorer does then find and display all the tests, but as soon as I make any change to the test file, they disappear again.
Possible Solution
Not a solution, but I'm guessing this happens because the language server initially only recognizes literal tests when it scans the test files - not functions that will ultimately evaluate to be tests. So it might not be possible to detect where all the tests are without actually running the tests at least once?
Steps to Reproduce (for bugs)
See code above.
Context
I was just trying to avoid some boilerplate in my test functions - the real use case was tests for a parser, where I basically just need to compare a bunch of string inputs with a bunch of outputs. So the body of all the tests is identical, only the inputs and outputs change. So writing out all the test bodies by hand seemed like unnecessary work.
The current user experience is a bit suboptimal because if, for example, I make a change to one test and want to rerun that test only, I can't find and click it in the test explorer, because changing the code will have caused it to disappear. So instead I need to run all tests, and then expand all the nodes in the test explorer tree until I get back to the one test I wanted to look at.
Your Environment
Version used: 2.4.1
Editor name and version: VS Code 1.68.0
Environment name and version: nodejs 16.13.0
Operating System and version: Linux x64 5.15.0-37-generic (Xubuntu)
The text was updated successfully, but these errors were encountered:
edkelly303
changed the title
Test explorer doesn't find tests
Test explorer sometimes doesn't find all tests
Jun 19, 2022
I'm not sure how the code-walking works, and this could be a stupid suggestion... but could the walker add a node to the test explorer tree each time it finds a "describe", even if it can't actually find a test in the list underneath that describe?
Given this test file:
Expected Behavior
I would expect the test explorer panel to find and display all three tests in the tests list when you open or refresh the panel.
Current Behavior
The explorer panel only finds the first test
If I click the button to run all tests, the explorer does then find and display all the tests, but as soon as I make any change to the test file, they disappear again.
Possible Solution
Not a solution, but I'm guessing this happens because the language server initially only recognizes literal tests when it scans the test files - not functions that will ultimately evaluate to be tests. So it might not be possible to detect where all the tests are without actually running the tests at least once?
Steps to Reproduce (for bugs)
See code above.
Context
I was just trying to avoid some boilerplate in my test functions - the real use case was tests for a parser, where I basically just need to compare a bunch of string inputs with a bunch of outputs. So the body of all the tests is identical, only the inputs and outputs change. So writing out all the test bodies by hand seemed like unnecessary work.
The current user experience is a bit suboptimal because if, for example, I make a change to one test and want to rerun that test only, I can't find and click it in the test explorer, because changing the code will have caused it to disappear. So instead I need to run all tests, and then expand all the nodes in the test explorer tree until I get back to the one test I wanted to look at.
Your Environment
The text was updated successfully, but these errors were encountered: