-
Notifications
You must be signed in to change notification settings - Fork 388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Failure Navigation #14
Comments
There already are even two ways to do it in vim-test:
It's included in the readme, but I will try to emphasize it more and explain what each strategy does. |
From what I can tell, using either I've seen other testing plugins feed the results into the quickfix window and allow the user to jump to the specific line on which each test failed using Is similar functionality available through vim-test? |
What test runner are you using with vim-test? When a quickfix list is loaded with the output, but the failures are not "linked" to the file locations, that happens when the "compiler" for that test runner doesn't exist. What Vim compilers do is they are able to read the test output, and create a quickfix list out of it (which can be traverse with Unfortunately, if the compiler doesn't exist for your test runner, vim-test can't provide it for you, because I would like to limit the scope of what vim-test does. |
Also, which other testing plugins do the quickfix? I would just like to take a look. |
I am using py.test for my test runner. I can't recall exactly which testing plugin it was. It was some time ago. I believe it was https://github.com/reinh/vim-makegreen with the following command: |
For Python there is a "pyunit" Vim compiler, maybe it works for py.test. Try :compiler pyunit
:set makeprg=py.test\ your\ test\ command Then run |
I'm using the vim-makegreen plugin as a custom strategy in vim-test with this in
It may also be necessary to have the following
This works for me to show the green or red bar at the bottom, plus the command output goes into the quickfix buffer. |
In quite the same subject (tell me if I'm out of thread), is it possible to jump to the first failed test ? I'm working essentially with rspec and minitest. |
Well, since dispatch.vim generates a quickfix list with file locations from the test runner output, you can jump to the first failed test in the same way as you would jump to any first item in a quickfix list, with |
I have noticed that this is a common question and until recently I didn't know you could leverage Dispatch and the compiler functionality to do so. If I get time I will create a PR that explains this in the README. |
@codeinabox I was hoping that people would just take a look at the documentation for each strategy to see if there is one that populates the quickfix list, but I guess it makes sense to explicitly document Dispatch.vim as it's probably the most comfortable strategy. You could also mention that |
It would be convenient if there was an option to feed failures to the quickfix window and to be able to navigate to the failure lines the usual quickfix mappings. I've seen other vim testing plugins do this.
The text was updated successfully, but these errors were encountered: