nvim-neotest / neotest

An extensible framework for interacting with tests within NeoVim.
MIT License
2.22k stars 107 forks source link

[FEAT] Inspect the test commands run by Neotest #272

Open fnune opened 1 year ago

fnune commented 1 year ago

Sometimes I want to copy the commands run by Neotest under the hood. There are different use-cases for this:

Currently I can't find a way to do this using Neotest's API. The best I could do is:

local position_id, args = neotest.run.get_last_run()

But position_id is just a test ID path. I want the full command, e.g. pytest -v <some-file> --bla-bla.

Any guidance would be appreciated if this needs to be implemented by my installation. Thanks, and thanks for the great plugin! <3

matthewgrossman commented 5 months ago

Just want to flag, I'm also interested in this. With vim-test, I use a custom ClipboardStrategy: https://github.com/matthewgrossman/dotfiles/blob/5e0b3b99a604cb6704e0dd9b2b8a7054ac1fd3d9/config/nvim/vimscript/init.vim#L30-L34

Rather than sending the command to a terminal/etc, it just places the command into my clipboard. Is there a way you'd imagine that could work with strategies in neotest?