-
-
Notifications
You must be signed in to change notification settings - Fork 290
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
feat(busted): option to filter tests to run by pattern [wip] #378
base: master
Are you sure you want to change the base?
Conversation
lua/plenary/busted.lua
Outdated
@@ -214,7 +233,9 @@ after_each = mod.after_each | |||
clear = mod.clear | |||
assert = require "luassert" | |||
|
|||
mod.run = function(file) | |||
mod.run = function(file, opts) | |||
_PlenaryBustedOpts = vim.tbl_deep_extend("force", {}, opts or {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doing a global is technically fine because busted is already run in another process. But can't we do
-- top of the file
local busted_opts
--- ......
mod.run = function(file, opts)
busted_opts = vim.F.if_nil(opts, {})
-- ...
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, thanks! Although I did a vim.F.if_nil(opts, {}, opts)
(3rd arg) 👍
Overall Looks good. Thanks :) |
Thanks @Conni2461! plenary.nvim/lua/plenary/test_harness.lua Line 33 in 9f033d1
It seems we're doing some hacking there to parse the second argument as a lua table manually? But adding a second field to the table causes an error. I'm guessing it doesn't like the comma in {minimal_init = 'tests/minimal_init.lua', filter = 'test'} ?
EDIT: found this #284 |
This is a step towards being able to run individual tests. See #343.
I'm just starting with lua and vim plugin development as well so, be gentle 😆.
Todo
TODO
s in the code).